cron is a task schedueler based on clock time that runs on Linux based machines.
35
votes
2answers
841 views
What is the point of system-autodeath?
In a previous question I found a "system autodeath cron job" which would shut down my default network route daily.
As I have never heard of such a thing before, I would like to know what it exactly ...
21
votes
6answers
20k views
19
votes
7answers
25k views
Run a command every week with Cron?
Simple question- what would a crontab entry look like for a command I want to run every week on Saturday at 8:05 AM?
15
votes
3answers
11k views
How to run a cron job as a specific user?
I would like to run a cron job as a specific user on my machine. How may I specify the user for a cron job to run as?.
I am running on Ubuntu 10.0.4
[Edit]
The cron jobs will be running on a ...
14
votes
3answers
8k views
Log of cron actions on OS X
Does the cron which comes with OS X log its actions anywhere?
I'm not looking for output of any particular cron job, but rather log of what cron is doing. On a couple linux machines I've checked, ...
9
votes
4answers
5k views
Can I make cron “random”?
Maybe I'm completely nuts, and if so - that's fine. But how would I schedule a job to on-some-random-schedule broadcast a goofy message, like from fortune?
clarification
yes - this is my personal ...
8
votes
2answers
3k views
Common Mac OS folders/settings to check (when trying to get rid of a pesky self-launching app)
If there's an app that starts up by itself, what would the most efficient places to look for it be? Does anyone have a nice comprehensive list of where to check for Startup Items, Login Items, Login ...
8
votes
1answer
4k views
Run a cron job every 5 minutes between two times
Is there a way to specify a job that runs every 5 minutes between some start time and some end time on business days in a crontab?
Update
I think it's relevant that my start and end times are not at ...
7
votes
4answers
10k views
How can I view results of my cron jobs?
I see so many guides on how to run crontab, but what I need right now is to learn how to
Find log files about cron jobs
Configure what gets logged
7
votes
6answers
5k views
Error adding cronjobs in Mac OS X Lion
Until now, I have never attempted adding a crontask on my Mac. To my surprise, it threw an error..
[hayek@mac:/www/] 02:33:22 PM: crontab -e ...
7
votes
3answers
2k views
How can I create a cron job that runs a task every three weeks?
I have a task that needs to be performed on my project schedule (3 weeks).
I'm able to set up cron to do this every week, or (for example) on the 3rd week of every month - but can't find a way to do ...
6
votes
3answers
2k views
Use cron to screen capture on Mac OS X
To analyze my own computer usage, not to spy on anyone (although it crossed my mind), I want to have cron capture the current screen every minute.
* * * * * /bin/bash -c "/usr/sbin/screencapture ...
6
votes
1answer
784 views
How to schedule a task with the Task Scheduler on Windows 7 that runs one minute later each day?
How to schedule a task with the Task Scheduler on Windows 7 that runs one minute later each day? That is on day one it runs at say 10:00 then the next day at 10:01, etc.
5
votes
5answers
7k views
cron: run a process but only if it isnt running?
Is there a way for me to tell cron to run an app BUT not run it if a process exist already?
5
votes
5answers
19k views
5
votes
3answers
2k views
Run Linux script at time 'n' on first day, 'n+15 mins' next day, and so on
I'm trying to take timelapse images using my webcam. What I want to do is run a script at midnight on 1st Jan, then 00:15 on 2nd Jan, 00:30, 3rd Jan and so on. This can keep running forever, I'll ...
5
votes
2answers
3k views
using either notify-send or zenity in Cron
I am trying to get cron to provide a screen alert when it spots a particular situation. I know the script is executed each minute but it will not display on the screen.
script executed is:
...
5
votes
3answers
4k views
How to set cron PATH globally (i.e. for all users) permanently?
We need to have /usr/local/bin in cron's path for all users. Is there a way to set it system-wide, without needing to edit each individual user's crontab?
We've tried adding PATH to /etc/crontab:
# ...
5
votes
1answer
970 views
Only email on cron errors for jobs in cron.daily, cron.hourly, etc
I have several cron jobs that run (in /etc/cron.daily, /etc/cron.hourly, /etc/cron.weekly, etc.) and email root@localhost with the results. I'd like to stop those emails if the jobs are succeeding, ...
4
votes
9answers
909 views
How can I write a cron job that will block my internet from 7pm to 7am? (So I can get some sleep)
I am using OSX 10.6 and it has cron built in. How can I write a cron job that will block my internet from 7pm to 7am every day?
Im sure this must be simple but I could only find one example online ...
4
votes
3answers
11k views
How do I run a launchd command as root
I have the following launchctl command as a .plist file. It's loaded and set to run once a day but, it needs to run as root and I'm not sure how to verify this.
Also, this cron job basically CDs ...
4
votes
4answers
2k views
with a shell script, it is possible to tell when it's run with cron vs run manually?
with a shell script, it is possible to tell when it's run with cron vs run manually?
UPDATE:
it was asked why I want to know. My cron job will be logging, and i want to be able to log if someone ...
4
votes
4answers
824 views
cron runs but nothing happens
I have created a script called "forward_email.sh" and set permissions to 777. It contains the following line:
echo "It worked: $(date)" >> /home/noc/email.log
I created a cron job with the ...
4
votes
4answers
3k views
how to make run cron on OSX 10.6.2?
Note:
this question is not about how to edit cron tab but how to make cron work
I edited my cron using env EDITOR=joe crontab -e
I entered 1 * * * * echo 'test' > ...
4
votes
4answers
5k views
bash: using scp in cron job fails, but runs succesfully when run from command line
I am trying to use scp in a bash script run by cron (I am running this on Ubuntu 10.0.4 LTS).
The script works fine (i.e. transfers and copies file1 and file2 to/from the remote server, when I run it ...
4
votes
1answer
3k views
what is run-parts in /etc/crontab, and how do I use it.
I have been digging through my Linux system. To try and understand how it all works
In the /etc/crontab file. I see the following
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * ...
4
votes
3answers
2k views
Run a cron job on the first Monday of every month?
I'd like to run a job from cron at 8.30 on the first Monday of every month. The cron Wikipedia page says
While normally the job is executed when the time/date specification fields all match
...
4
votes
2answers
1k views
cron can't read PYTHONPATH environment variables?
I have added to the PYTHONPATH on my server's .bash_profile file. However it appears that cron isn't reading from it because I am getting import errors. If I run the exact command cron calls on the ...
4
votes
2answers
656 views
Can Ubuntu play a video via cron job?
I'm developing a display system for a paint shop.
I've set up a computer with Ubuntu to run the video and display it on a TV, running a PHP script that should update the video every hour via the ...
4
votes
2answers
2k views
Set a cron every certain hours between certain hours
How can I set a cron to run every 2 hours between 8 am and 5 pm for example? Is this possible?
4
votes
2answers
706 views
How do I create a cron job that will commit my project changes to git on a weekly basis
I'm using git for the purposes of making a historical transcript of the changes made to my project. I understand it's not the ideal usage but it's the usage pattern I've chosen for various reasons ...
4
votes
4answers
793 views
Mac crontab is never created
I am trying to setup a cron on my mac, but it seems that it never finishes creating a crontab for my user. I open terminal and enter:
$ crontab -e
Which returns this:
crontab: no crontab for ...
4
votes
2answers
418 views
From what context is a cron task executed?
I am asking this question after royally destroying a Linux box. Let me give you some background so you know where I am coming from.
I currently have (well... did have) a RedHat Linux box running ...
4
votes
2answers
656 views
Should I worry about Daylight saving time when planning to schedule backups?
So if there is a day:
https://secure.wikimedia.org/wikipedia/en/wiki/Daylight_saving_time
when we have to e.g.: set our clock back from 3am to 2am. Ok.
So if someone creates a cron job at 3am, ...
4
votes
2answers
341 views
Auto suspend after X minutes to stop myself procrastinating
Right now, I'm using a line in /etc/crontab to run pm-suspend every 30 minutes, but I would like an application displaying a warning before suspending (for example a countdown in the taskbar). An ...
4
votes
2answers
697 views
rsync over SSH with cron in osx-environment
I want to automatically download files and folders from a Linux server to which I have an SSH (and FTP) account. The files shall be downloaded on a regular basis (I suppose a cron is the right tool to ...
3
votes
4answers
5k views
How can I permanently fix my date synchronize problem in linux?
Ubuntu 7.10 server i386 clock/date/time won't stay in sync. Are their log files I can view to tell when the clock changes? For a temporary fix, I created a file in /etc/cron.hourly:
#!/bin/sh
ntpdate ...
3
votes
4answers
383 views
How do I add a job to cron?
So, here's what I did:
Logged in as root via Shell
Typed crontab -e
Typed */30 * * * * /path_to_website/cronjobs/cron.php
And now what? How do I save it? I just closed Putty and then logged back ...
3
votes
2answers
2k views
Difference between /etc/crontab and “crontab -e”
What is the difference between the crontab located in /etc/crontab and the crontab that can be edited using crontab -e?
3
votes
2answers
2k views
Bash to delete a files older than X days
So I have a cron setup to make backups of a folder into a tarball every hour. I would like to add into the shell script that I'm using the ability to have files deleted automagically after about three ...
3
votes
4answers
3k views
Verify that a cron job has completed
Is there a command that can be run to verify that a users cron job has run successfully?
Platform is Ubuntu 8.04 LTS.
I have scripts in /home/useraccount/bin/
running
crontab -l
while logged ...
3
votes
2answers
3k views
linux: how to run a command in a given directory
I simply want to just run a command (actually its a shell script) from a given directory as a cron job. How can I run it so that it is set to a given directory without using cd.
3
votes
1answer
3k views
How to use @reboot for crontab with delay
In crontab, I can use @reboot to run a command after the system reboot. Is there a way to do this with an delay, i.e. run a command after 10 minutes of reboot?
3
votes
1answer
107 views
Cron job once a minute for one hour a day
Is there a way to run a cron job once a minute for an hour every day?
I know I can probably make 60 cron jobs to do this but that would make it difficult if I ever needed to edit the job.
3
votes
2answers
84 views
Found a script on my cron.monthly, i am wondering what's it doing?
I am new to bash-programming, sorry if this might be a kind of stupid question. I found a script on my server and i am trying to understand every line:
#!/bin/sh
#
# man-db cron weekly
set -e
if ! ...
3
votes
2answers
1k views
ssh Permission denied only in cron job
Having a very strange problem. I've created a small bash script which runs a command on a remote host via ssh (using public key authentication).
When I run this script manually from the command line ...
3
votes
2answers
556 views
How to run webcam software only when I am not home (phone is not on the LAN)?
Currently I've got my user cron starting Motion on a timer when I typically leave for work, and then killing it when I typically get home, so I can watch my cat/burglars/etc:
0 9 * * * killall motion ...
3
votes
1answer
55 views
What does this crontab line do?
What does this crontab entry do? I'm thinking it means run the jobs.sh script every Monday at 11AM. Is this correct?
0 11 * * MON /home/username/jobs.sh
3
votes
4answers
3k views
Are there any good crontab syntax checkers, or entry tools?
Recently a user on one of our systems (linux Ubuntu, but any *nix would be the same) had a crontab file missing a terminating newline.
It is common for *nix configuration files to require that ...
3
votes
1answer
55 views
Root account locked/suspended?
I'm shipping ts7800 boards running debian 6.07.
After programming, some boards do not run their cron jobs, complaining that they do not recognise the user root.
This happened on 2 out of 12 ...