LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-13-2005, 01:21 PM   #1
wormraper
LQ Newbie
 
Registered: May 2005
Posts: 11

Rep: Reputation: 0
Crontab


hello everyone I have a slight problem. I'm trying to set up cron to create a sheduled task to reboot my linux server every night (not my idea, I've just got to do what the office tells me to do) anyways, I've got a crontabe file created that should reboot the system at (insert time) every day but it doesn't seem to initiate the crontab file. do I have to do anything to initialize cron? un comment a config file or something? i'm not sure myself being that this is the first time I've used crontab. any help would be appreicated
wormraper
 
Old 05-13-2005, 01:27 PM   #2
PhilD
Member
 
Registered: Mar 2003
Location: Iowa, US
Distribution: Gentoo!!, Mandrake 9.1
Posts: 170

Rep: Reputation: 30
use the command:

crontab -e

to edit the file. that should open up a vi editor with the cron file. When you close it, it should automatically update cron. You will need to be root (so you can reboot) otherwise it edits the crontab file for your user.

If this is how you did it then I am not sure. This is how I edit mine.

PhilD
 
Old 05-13-2005, 01:40 PM   #3
wormraper
LQ Newbie
 
Registered: May 2005
Posts: 11

Original Poster
Rep: Reputation: 0
yeah, I've done that too. and it seems to go fine until it executes the reboot file. I can execute the reboot file manually so I know it's not a problem with the file. cron just doesn't seem to want to freakin execute it.
wormrapre
 
Old 05-14-2005, 12:17 AM   #4
PhilD
Member
 
Registered: Mar 2003
Location: Iowa, US
Distribution: Gentoo!!, Mandrake 9.1
Posts: 170

Rep: Reputation: 30
I noticed with one of my scripts that cron doesn't have the same environment as the user. I think this is true even for root. Try puting in the full path to "reboot" or "shutdown" in your script. (either in cron or your write script that cron calls) See if that doesn't help!

PhilD
 
Old 05-15-2005, 02:01 AM   #5
wormraper
LQ Newbie
 
Registered: May 2005
Posts: 11

Original Poster
Rep: Reputation: 0
I finally got it. I put the full shutdown command in cron
thanks guys
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab x2??? killahsmurf Slackware 2 05-24-2005 11:53 PM
using crontab goodolday Linux - Newbie 1 04-26-2005 08:16 PM
How to use crontab ? Dakkar Linux - Newbie 2 01-22-2004 11:49 AM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 01:35 PM
HELP!! crontab karleong Linux - General 9 07-12-2003 11:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:43 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration