Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-05-2009, 08:36 AM   #1
LQ Newbie
Registered: Apr 2008
Distribution: fedora 11
Posts: 19

Rep: Reputation: 0
cron restart in fedora 11


I am trying to schedule a restart every day at 16:00.
some say that I should edit the /etc/crontab file, while others say that I should use the crontab -e command to specify a cron job....

I don't know the difference, what I know is that both did not work with me...

However, I'll list my small script along with the result of ( crontab -l ) and the logs in /var/log/cron...

The scriptIt's location /etc/
shutdown -r now
[root@fedora11 bin]# crontab -l
0 16 * * * /etc/
[root@fedora11 bin]# tail /var/log/cron
Aug 4 19:05:54 fedora11 crontab[4248]: (root) BEGIN EDIT (root)
Aug 4 19:06:01 fedora11 crond[4132]: (root) RELOAD (cron/root)
Aug 4 19:06:10 fedora11 crontab[4248]: (root) REPLACE (root)
Aug 4 19:06:10 fedora11 crontab[4248]: (root) END EDIT (root)
Aug 4 19:07:01 fedora11 crond[4132]: (root) RELOAD (cron/root)
Aug 4 19:07:01 fedora11 crond[4132]: (CRON) INFO (running with inotify support)
Aug 4 19:07:01 fedora11 CROND[4260]: (root) CMD (/etc/ )
Aug 4 19:07:03 fedora11 crontab[4266]: (root) BEGIN EDIT (root)
Aug 4 19:07:05 fedora11 crontab[4266]: (root) END EDIT (root)
Aug 4 19:28:18 fedora11 crontab[4342]: (root) LIST (root)

So why doesn't this work?
I've taken all precautions that I know:
-chmod 755 /etc/
-The shutdown command can be executed by root user only so I checked the group and user owners of /etc/ and /etc/ ... and they are set to root.
- I restart the crond service and reload it.
- I executed the script : /etc/ and it restarted my comp. but it doesn't do the same using cron......!!!!!!

Thanks for ur help..
Old 08-05-2009, 09:56 AM   #2
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2015, Slack14.1 DebJessie, + 50+ other Linux OS, for test only.
Posts: 15,612

Rep: Reputation: 2989Reputation: 2989Reputation: 2989Reputation: 2989Reputation: 2989Reputation: 2989Reputation: 2989Reputation: 2989Reputation: 2989Reputation: 2989Reputation: 2989
'cron' will understand a full path only :

/sbin/shutdown -r now


Last edited by knudfl; 08-05-2009 at 01:22 PM.
Old 08-05-2009, 10:23 AM   #3
LQ Newbie
Registered: Feb 2009
Posts: 13

Rep: Reputation: 1
this URL will be of help
Old 08-08-2009, 04:18 AM   #4
LQ Newbie
Registered: Apr 2008
Distribution: fedora 11
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks, that "full path order" solved my problem.



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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron - restart screens - how? Tomek58 Debian 3 12-26-2008 11:26 AM
Cron restart script wont work! ThaHabbis Linux - General 3 03-16-2007 04:38 AM
Why do I have to restart cron each boot? ericcarlson Linux - Software 4 02-14-2007 05:20 AM
Cron job to check/restart network connection? mac_phil Linux - Networking 6 09-01-2004 01:51 PM
cron job to restart process if dead gborrageiro Linux - General 3 09-25-2002 11:55 AM

All times are GMT -5. The time now is 07:57 AM.

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