Cron is used to execute scheduled commands. It acts as a task scheduler on Linux and UNIX systems which will execute commands at specified times set by the user. Cron has a great deal of customization and is often used on server environments where common tasks are run on a regular basis.

learn more… | top users | synonyms (2)

2
votes
2answers
4k views

Problem with crontab, script runs when executed from command

this is my cron entry: */5 * * * * /home/user/scripts/backupDB.sh && echo "Backup Successful: $(date)" >> /home/user/tmp/mybackup.log This is the script that is called: #!/bin/sh ...
9
votes
4answers
10k views

Why does apt-get fail when automated with cron?

I'm trying to use cron to automate my system updates. You can see my crontab, commands, and resulting errors below. When I run upgrades.sh as root, the script runs fine. When cron runs it, apt-get -y ...
2
votes
3answers
3k views

cron.daily seems to run but doesn't log any activity

We have a number of scripts setup to run in the /etc/cron.daily directory - some of them show evidence of being run at about the right time (files are archived/compressed and truncated), but others ...
163
votes
31answers
229k views

Reasons why crontab does not work

Often, crontab scripts are not executed on schedule or as expected. There are numerous reasons for that: wrong crontab notation permissions problem environment variables This community wiki aims ...
0
votes
1answer
2k views

What is proper setup for “anacron”?

I am running Ubuntu 9.10 and 10.04 on MediaTemple (ve) servers. On both of them, the anacron setup is broken, ... and they have been broken since I first installed Ubuntu. It has only come to my ...
3
votes
2answers
4k views

Is there a way to suspend/sleep via bash?

I have to get nine 46" LCD monitors (running Windows) to suspend/sleep at 8pm and wake at 8am every morning. It's been a bit of a mess trying to get the commands working, including the privileges. ...
8
votes
4answers
4k views

“Backup Intervals” in rsnapshot.conf?

A simple question about rsnapshot. In order to perform daily backups I'm going to add lines to cron in my Ubuntu. Then, why do I have also these lines in the rsnapshot.conf ? ...
3
votes
2answers
4k views

Cron scheduling: Is the hour argument in 24h format?

In order to run cron in the night at 4 o'clock I need to write 4 * * * *? And to run at 16.00 o'clock, it should be 16 * * * *? thanks
2
votes
1answer
2k views

How to automate mysql backups?

I want to automatize the backup of my databases and files with cron. Should I add the following lines to crontab ? mysqldump -u root -pPASSWORD database_name | gzip > /home/backup/database_`date ...
3
votes
5answers
5k views

Cron jobs show up in GNOME Scheduler but don't execute

I have configured Back In Time and MySQL Administrator to make a backup every day at 15:00. In order to be sure I have installed Gnome Scheduler to see whether these two applications are registered ...
5
votes
2answers
2k views

How can I create a cron command that will execute a command inside a detached screen?

I have created a screen, but can I now somehow execute a command that will run commands in the detached screen? I do not even know if this is possible, but if it is, it will probably be something ...
3
votes
1answer
948 views

How to use crontab, .netrc, and git push?

I am in the process of automating the backups from various servers to a central point then pushing those config changes into a git repo so I can track any changes over time. The rest of the scripts ...
0
votes
4answers
450 views

How can I set up Ubuntu to install updates without asking? [duplicate]

Possible Duplicate: How do I enable automatic updates? I would like to have Ubuntu silently install updates every day or so. It it possible to set it to do so? Are there any potential ...
3
votes
1answer
2k views

CRON is changing encoding?

I have a legacy Java program that outputs an SQL script. I then use Apache Derby to run that SQL on the target database (which is not on the same server as CRON). When run via putty, this works fine. ...
2
votes
1answer
745 views

Cron mail notification

I would like to disable crontab mail notification for one of my task... I run this task every minute, that means 1440 mail per day :S Can someone tell me if this is possible and how can I do this?
15
votes
5answers
14k views

Cron.hourly won't run

Ok, So I've made my script, I dropped it in /etc/cron.hourly then I chmod 777 the file but it won't run (automatically). If I manually run it, it works fine. Do I need to do anything else?
7
votes
3answers
13k views

How can I setup a Mail Transfer Agent?

I intend to use mutt to send automated emails via cron or at with attachments to my gmail address when particular events happen on my Ubuntu server. Currently, mutt cannot send email to external ...
2
votes
2answers
2k views

Function of /etc/cron.hourly

If I create a script and then place it in this folder (/etc/cron.hourly), will my system run this script hourly? Or does my script need to begin with a command as well?
3
votes
1answer
130 views

Using % in a cron command

Since the % has special meaning to cron, how do I use it as part of a command? I found this page http://www.hcidata.info/crontab.htm, which mentions piping echo and sed to escape the % and then ...
1
vote
2answers
3k views

How can I setup nightly backups via the command line?

I'm running Ubuntu Server and I'm looking for an efficient way of performing nightly backups of particular directories using cron. However, since the computer isn't always on, I'd like it to just run ...
2
votes
2answers
892 views

How can I use cron to schedule a script that implements daylight saving on a non- DST aware application when my server automatically uses DST?

My server (running ubuntu 8.04LTS server) reports the time as 9:38PM BST right now. BST (British Summer Time) is 1 hour ahead of UTC (or Greenwich Mean Time if you really want to confuse matters) The ...
4
votes
6answers
3k views

How to run cron job when network is up?

I have some anacron jobs which run daily. The scripts update local bzr and git repositories. Naturally these scripts need working network connections. I'm on a laptop and often wired and wireless ...
6
votes
5answers
9k views

What's wrong with my cron.hourly configuration?

Every hour I get an email with error like this, Subject: Cron <root@supa> root cd / && run-parts --report /etc/cron.hourly /bin/sh: root: not found Contents of /etc/crontab is as ...
132
votes
5answers
181k views

How do I set up a Cron job?

How do I add Cron jobs in Ubuntu?
38
votes
5answers
37k views

How are administrators supposed to read root's mail?

What is the Ubuntu way for system administrators to receive system notifications, which typically take the form of e-mail sent to the root account? Examples of such notifications are the output of ...
14
votes
7answers
59k views

How to run scripts every 5 seconds using cron?

I have a script that needs to be run every five seconds. I know that cron can do tasks by the minute, but is there a way to run something every second?
23
votes
1answer
22k views

How do I make cron email my @gmail account

I have a couple of cron jobs that somethime produce error output and would like to get a notification in my "real" email account, since I don't use my user's mailbox in my Ubuntu laptop, but cron (or ...
2
votes
3answers
472 views

Backup bash script is not gzipping its tarball

I have a bash script that runs as a cron to backup files on the server. #!/bin/bash FILE=/path/to/backup_$(date +%Y%m%d).tar tar -cf $FILE /backup/this /and/that /and/someotherfiles gzip $FILE When ...