LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   crontab problem (https://www.linuxquestions.org/questions/linux-general-1/crontab-problem-280109/)

provo1234 01-20-2005 10:30 AM

crontab problem
 
Hi

I have a Redhat Enterprise Linux box. Here's how my /etc/crontab file looks.

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

# Weekly back-up script that runs on Monday morning at 1:15AM
15 1 * * 1 /u/system/b 2>/u/system/b.out

# Daily back-up script that runs on Tue,Wed,Thu,Fri,Sat mornings
15 1 * * 2-6 /u/system/d/d 2>/u/system/d/d.out


Both the weekly and the daily back-up scripts aren't getting triggered by the cron deamon. I restarted the cron daemon but it did not help.

When I type "crontab -l" while logged in as root, I get a message which says "no crontab for root". Do I need to add "root" to the two lines that I have added to the crontab? What could I be doing wrong. I edited the /etc/crontab file using the command "vi /etc/crontab". I did not use "crontab -e".

Thanks
Andre

acid_kewpie 01-20-2005 10:35 AM

/etc/crontab is *NOT* root's crontab file. it is the system wide crontab file, which has, as you've guessed, that extra column defining who the process will run as. the root user has a seperate user crontab file, you can use if you wish. if you run "crontab -e" you'll see none of those entries are visible, because it's a different file.

provo1234 01-20-2005 02:38 PM

Thanks for the reply. I just had to add the username (in my case, root) in those two lines!

wpn146 01-21-2005 12:20 PM

Quote:

Originally posted by provo1234
Thanks for the reply. I just had to add the username (in my case, root) in those two lines!
You should really be using "crontab -e" for this.


All times are GMT -5. The time now is 09:10 AM.