Hi I'm trying to understand the syntax for a cron job that I'd like to run once a day. I've put a script into /usr/bin which will create a tape archive once a day and then drop it into a CD with CD-Record. The script works fine but I can't get cron to run the script which is called backup and is in /usr/bin/backup. Would the syntax be something like this to run at 7.00 p.m. at night ? ... 14 0 * * * root /usr/bin/backup Probably not but some help would be welcome. Read the man pages and other docs. Didn't make a lot of sense to me. Thank you -- Richard
The script works fine but I can't get cron to run the script which is called backup and is in /usr/bin/backup. Would the syntax be something like this to run at 7.00 p.m. at night ? ...
14 0 * * * root /usr/bin/backup
try : bash> crontab -u root -e 0 19 * * * /usr/bin/backup This will run backup at 7pm every night as user root. Kind regards, Paul Miles All Secure Networks Visit www.allsecuredomain.com for low cost web hosting and domain registration ----- Original Message ----- From: "Richard Ibbotson" <richard@sheflug.co.uk> To: <suse-linux-e@suse.com> Sent: Monday, April 01, 2002 2:52 PM Subject: [SLE] Cron
Hi
I'm trying to understand the syntax for a cron job that I'd like to run once a day. I've put a script into /usr/bin which will create a tape archive once a day and then drop it into a CD with CD-Record.
The script works fine but I can't get cron to run the script which is called backup and is in /usr/bin/backup. Would the syntax be something like this to run at 7.00 p.m. at night ? ...
14 0 * * * root /usr/bin/backup
Probably not but some help would be welcome. Read the man pages and other docs. Didn't make a lot of sense to me.
Thank you
-- Richard
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com
The not at all confusing multiple crontab system that linux uses is part of your problem here. The line: 0 19 * * * root /usr/bin/backup would work if it was in a file named /etc/cron.d/backup all on its own. but in the normal cron system which exists in the "real" Unix world and which the linux system is backwards compatible with would use 0 19 * * * /usr/bin/backup which would be placed alongside all the other root cron jobs in the file /var/spool/cron/tabs/root (crontab -e to open it in your default editor). If you use crontab -e then when you save the file the cron task will reread the file, otherwise you might need to do a kill -HUP of it to read in the changes. If you have a look in /etc/ you'll also find about 5 other cron.something directories which are run from a main /etc/crontab file at varying times Simple, isn't it? :) Ewan On Mon, 2002-04-01 at 13:52, Richard Ibbotson wrote:
Hi
I'm trying to understand the syntax for a cron job that I'd like to run once a day. I've put a script into /usr/bin which will create a tape archive once a day and then drop it into a CD with CD-Record.
The script works fine but I can't get cron to run the script which is called backup and is in /usr/bin/backup. Would the syntax be something like this to run at 7.00 p.m. at night ? ...
14 0 * * * root /usr/bin/backup
Probably not but some help would be welcome. Read the man pages and other docs. Didn't make a lot of sense to me.
Thank you
-- Richard
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com
participants (4)
-
Christopher Mahmood
-
Ewan Leith
-
Paul Miles
-
Richard Ibbotson