LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-20-2005, 09:30 AM   #1
provo1234
LQ Newbie
 
Registered: Dec 2004
Posts: 12

Rep: Reputation: 0
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
 
Old 01-20-2005, 09:35 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
/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.
 
Old 01-20-2005, 01:38 PM   #3
provo1234
LQ Newbie
 
Registered: Dec 2004
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for the reply. I just had to add the username (in my case, root) in those two lines!
 
Old 01-21-2005, 11:20 AM   #4
wpn146
Member
 
Registered: Jan 2005
Distribution: Solaris, Linux Fedora Core 6
Posts: 170

Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Crontab Problem smus Linux - Newbie 4 12-10-2005 08:52 AM
Problem with crontab PierrePau Linux - Software 3 06-28-2004 02:34 PM
crontab problem BlackRabbit Linux - General 9 06-17-2004 07:38 AM
problem with crontab juanb Linux - Newbie 2 12-16-2003 04:54 AM
crontab problem TomTheNewbie Slackware 1 07-09-2003 07:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration