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? |
Is it already running?
Code:
ps -e | grep cron Code:
sudo /etc/init.d/cron restart |
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. |
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 ? |
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 |
All times are GMT -5. The time now is 11:06 AM. |