LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Can't get cron job to start (http://www.linuxquestions.org/questions/linux-desktop-74/cant-get-cron-job-to-start-914003/)

von Stalhein 11-17-2011 03:48 AM

Can't get cron job to start
 
Hi all,
Since doing a fresh install of Ubuntu 11.10, I've not been able to get a cron job to start.

Code:

# Start at 2am, finish at 8am.
00 02 * * * /usr/bin/deluge
00 08 * * * killall deluge

As you can see - it's not rocket surgery :-) It used to work on the previous install of 10.04 without any issues.

Where do I start chasing down whatever's stopping it?
TIA

fukawi1 11-17-2011 04:22 AM

Cron uses a rather limited path, I am not 100% certain if killall will be in said path. Try using the full path to killall ($ which killall)

As a slightly unrelated note, did you know deluge has a scheduler plugin? Edit -> Preferences -> Plugins -> Scheduler

trappa01 11-17-2011 05:46 AM

Check that crond is running too.

von Stalhein 11-18-2011 04:03 AM

Thanks guys - yes. aware of the path requirement but it's not starting, afaik, so it doesn't need to stop :-)

As for the scheduler, yes, that's what I'm using as the alternative, but if it doesn't work for Deluge, it won't work for any other programs.

I'll check that crond is up and about.

ps -ef | grep cron gives
Code:

$ ps -ef | grep cron
root      1119    1  0 Nov14 ?        00:00:00 cron
Stephen  5743  5623  0 20:38 pts/1    00:00:00 grep --color=auto cron

Maybe it should be sudo crontab -e ?

Given that the stuff above means it's going - I've tried the sudo command, so see what happens tonight my time.

von Stalhein 11-19-2011 08:45 PM

Still no joy - happy to take any further advice.

teckk 11-26-2011 02:39 PM

Does
Code:

crontab -l
show the crontab loaded?
And have you edited the .cron file without unloading it first?
Quote:

ps -ef | grep cron
That only shows you that cron is running.

man crontab
man cron

Or are you editing the systems cron? Don't do that, make a user crontab.

von Stalhein 11-27-2011 04:51 PM

Output from above command follows:

Code:

@ubuntu:~$ crontab -l
# Start at 2am, finish at 8am.

00 02 * * * /usr/bin/deluge
00 08 * * * killall deluge

Sorry, not quite with you on the editing query. I've always done it via "crontab -e"

Will trawl the man info.

trappa01 11-28-2011 10:49 AM

Check that the user can use cron:

You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow. If that file does not exist, you can use
crontab if your name does not appear in the file /usr/lib/cron/cron.deny.
If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab.

teckk 11-28-2011 07:12 PM

You need to remove the cron file before you edit it is what I meant. That will cause problems sometimes.
Code:

crontab -r
Then reload it after you edit it.
Code:

crontab /path/mycronfile.cron
man crontab

von Stalhein 11-29-2011 03:22 AM

Quote:

Originally Posted by trappa01 (Post 4536452)
Check that the user can use cron:

You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow. If that file does not exist, you can use
crontab if your name does not appear in the file /usr/lib/cron/cron.deny.
If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab.

I have neither of those files or directories.

@teckk - I'll have a bash (no pun intended) at that process.


All times are GMT -5. The time now is 12:44 AM.