LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-06-2006, 07:41 PM   #1
Smaks
LQ Newbie
 
Registered: Feb 2004
Posts: 11

Rep: Reputation: 0
Having problems with cron


I am trying to use cron to run a daily backup script, the script checks to make sure that the person running it is root before it executes anything.

if [ "$USER" != "root" ]; then
echo "You must be root to run backup."
exit 1
fi


so far I have tried using root's crontab file with a like like this:

1 0 * * * /usr/local/sbin/backup

/usr/local/sbin/backup being the script that I want to run, I have also tried putting it into the crontab file with a line like this:

1 0 * * * root /usr/local/sbin/backup

everytime it comes back and tells me, "You must be root to run backup."

anyone have any ideas?
 
Old 10-06-2006, 07:44 PM   #2
Smaks
LQ Newbie
 
Registered: Feb 2004
Posts: 11

Original Poster
Rep: Reputation: 0
also, I am running it on fedora core 4
 
Old 10-06-2006, 11:58 PM   #3
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
i haven't try usig root's cron, but you can copy your script into /etc/cron.daily if you lazy to trouble shoot.
 
Old 10-07-2006, 07:32 AM   #4
ygloo
Member
 
Registered: Aug 2006
Distribution: slack
Posts: 323

Rep: Reputation: 30
see - http://www.jalix.org/ressources/linu...vrac/cron.html

Last edited by ygloo; 10-07-2006 at 12:35 PM.
 
Old 10-07-2006, 12:26 PM   #5
Smaks
LQ Newbie
 
Registered: Feb 2004
Posts: 11

Original Poster
Rep: Reputation: 0
thanks guys, the /etc/cron.daily worked perfectly
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM
problems using cron Mugatu Linux - Software 3 02-26-2004 02:15 PM
CRON problems jlinden Linux - Newbie 4 09-03-2003 12:23 PM
CRON problems jlinden Linux - General 1 09-02-2003 02:16 PM
Cron problems... jmeile Linux - Software 1 05-23-2002 12:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:02 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