cron is a task scheduler based on clock time that runs on Linux-based machines.

learn more… | top users | synonyms

38
votes
3answers
917 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 ...
34
votes
7answers
61k 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?
29
votes
8answers
37k views

How can I get a script to run every day on Mac OS X?

Cron? Launchd? iCal?? If so, how?
22
votes
3answers
13k 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, ...
19
votes
3answers
31k 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 ...
17
votes
5answers
23k 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
10
votes
4answers
7k 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 ...
10
votes
2answers
6k 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?
9
votes
2answers
4k 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 ...
9
votes
2answers
5k 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?
9
votes
1answer
6k 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 ...
8
votes
5answers
37k views

How to stop a currently running cron job?

How can I stop a cron job which is currently running?
8
votes
3answers
17k 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 ...
8
votes
8answers
6k 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 ...
8
votes
3answers
3k 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 ...
7
votes
5answers
10k 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' > ...
7
votes
1answer
8k 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 * * * ...
7
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
2answers
2k 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 ...
6
votes
5answers
5k 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 ...
6
votes
1answer
1k 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.
6
votes
3answers
6k 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
5answers
11k 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
1answer
204 views

Why does cron only offer minute granularity?

It feels like there are use cases for things you'd want to run once every 5 seconds, twice a minute, etc, but these are impossible with cron. Why hasn't second-level cron granularity been built into ...
5
votes
4answers
7k 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 ...
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
4k 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
2answers
2k 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
2answers
7k 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.
4
votes
9answers
1k 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
4answers
8k 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 ...
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
1k 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
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 ...
4
votes
2answers
1k 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
1k 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
10answers
17k views

How can I automatically take a screenshot of a website at a specified time? [closed]

I need to take a screenshot of a website automatically at a time specified by me. Ideally it would not be using my computer since it's not guaranteed to be on at the specified time. Is there some ...
4
votes
2answers
1k 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
708 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
1answer
3k views

crontab day of week vs. day of month?

I added this to /etc/crontab on a few different linux & freebsd systems: # monthly reboot: 3rd Tuesday of every month 56 07 15-21 * 2 root /sbin/shutdown -r now I want a reboot on the 3rd ...
4
votes
2answers
1k 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
1answer
207 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 ...
4
votes
1answer
2k views

Is there a aliases file for sSMTP?

I installed sSMTP for sending emails from command line. I want to create some alias for cron jobs: $ sudo vim /etc/aliases # append this line at the end myname: root $ newaliases ...
4
votes
2answers
580 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
1k 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
7k 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
4answers
690 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
1answer
7k 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
2answers
3k views

Problem with $RANDOM in crontab

I've got a strange problem with $RANDOM in cron. I wish to execute a command a random number of minutes after the cronjob fires. This example works directly in the terminal and delays the command up ...
3
votes
1answer
138 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.