LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-11-2007, 02:20 PM   #1
eng69
LQ Newbie
 
Registered: Dec 2005
Posts: 4

Rep: Reputation: 0
ubuntu cron problems


Can someone expain how the cron daemon works? I am using the current version of ubuntu server. when i try to start it with nothing in the crontab file, it fails to start.

I am using crontab -e to edit the crontab file.

I am using sudo /etc/init.d/cron start to try to start it.
then it says 'starting periodic command scheduler' and then [fail]

Right now the there is nothing in the crontab file.

Where do i begin to look to figure this out?
 
Old 02-11-2007, 04:48 PM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Is it already running?
Code:
ps -e | grep cron
Then try
Code:
sudo /etc/init.d/cron restart
and see if that helps..please post what you get from those, first.
 
Old 02-11-2007, 07:36 PM   #3
eng69
LQ Newbie
 
Registered: Dec 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Here are the results:

jeng4@ubuntu:~$ ps -e | grep cron
4622 ? 00:00:00 cron
jeng4@ubuntu:~$ sudo /etc/init.d/cron restart
Password:
* Restarting periodic command scheduler... [ ok ]
jeng4@ubuntu:~$

does this mean its running? i'm confused.
 
Old 02-13-2007, 01:46 PM   #4
epoo
Member
 
Registered: Aug 2003
Distribution: slackware 11, ubuntu 7.04
Posts: 165

Rep: Reputation: 30
it looks like cron is already running, as long as the cron refers to the cron daemon. on slackware its crond. as long as its running, you dont run the scripts yourself, you wait for them to kick in at the hourly/daily/whatever intervals that are set by the folder you put your job in. crontab -e will let you change the times that the hourly/daily/weekly/monthly scripts are run. does your script that you want cron to run work? its independent of cron, your script should work just by typing ./scriptname or sh scriptname, then when you put it in the cron folder it will do the same thing as it did before, just at timed intervals.

at what times do you want it to run ? are you creating a file or producing some kind of output so you at least know if it has run even if your script doesnt do what its intended to ?
 
Old 02-14-2007, 12:27 AM   #5
eng69
LQ Newbie
 
Registered: Dec 2005
Posts: 4

Original Poster
Rep: Reputation: 0
i have a simple script that uses wget to download a file, and then renames the file with the current date/time. The script works great when i run it. I want it to run every 5 minutes.

my crontab file looks like this:

*/5 * * * * /home/az511/wget.sh
 
  


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
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 02:57 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 02:50 PM
Synergy [vnc], ssh, cron and X from XP to Ubuntu zingfharn Linux - Software 1 03-19-2006 05:53 PM
cron problems deadite66 Linux - General 0 08-06-2005 07:29 PM


All times are GMT -5. The time now is 02:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration