LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 11-17-2011, 03:48 AM   #1
von Stalhein
Member
 
Registered: Jul 2008
Location: Thurgoona, Australia
Distribution: Ubuntu 19.10
Posts: 33

Rep: Reputation: 1
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
 
Old 11-17-2011, 04:22 AM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
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
 
Old 11-17-2011, 05:46 AM   #3
trappa01
LQ Newbie
 
Registered: Dec 2009
Posts: 20

Rep: Reputation: 8
Check that crond is running too.
 
Old 11-18-2011, 04:03 AM   #4
von Stalhein
Member
 
Registered: Jul 2008
Location: Thurgoona, Australia
Distribution: Ubuntu 19.10
Posts: 33

Original Poster
Rep: Reputation: 1
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.
 
Old 11-19-2011, 08:45 PM   #5
von Stalhein
Member
 
Registered: Jul 2008
Location: Thurgoona, Australia
Distribution: Ubuntu 19.10
Posts: 33

Original Poster
Rep: Reputation: 1
Still no joy - happy to take any further advice.
 
Old 11-26-2011, 02:39 PM   #6
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833
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.
 
Old 11-27-2011, 04:51 PM   #7
von Stalhein
Member
 
Registered: Jul 2008
Location: Thurgoona, Australia
Distribution: Ubuntu 19.10
Posts: 33

Original Poster
Rep: Reputation: 1
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.

Last edited by von Stalhein; 11-27-2011 at 04:57 PM.
 
Old 11-28-2011, 10:49 AM   #8
trappa01
LQ Newbie
 
Registered: Dec 2009
Posts: 20

Rep: Reputation: 8
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.
 
Old 11-28-2011, 07:12 PM   #9
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833
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
 
Old 11-29-2011, 03:22 AM   #10
von Stalhein
Member
 
Registered: Jul 2008
Location: Thurgoona, Australia
Distribution: Ubuntu 19.10
Posts: 33

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by trappa01 View Post
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.
 
  


Reply

Tags
cronjob, crontab



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
Have cron job start running at the half hour? ghurty Linux - Server 3 03-07-2011 12:57 PM
Unable to Start Cron Job kwidya Linux - General 4 07-10-2009 07:07 AM
How do I start a cron job that starts on the 22nd of the month, mrtg. GlennsPref Mandriva 8 02-06-2009 05:59 PM
Cannot stop/start services in cron job Sanford Stein Linux - Newbie 4 08-11-2008 04:41 PM
Cron Job: Start it Only once on specified time jCash Linux - Newbie 2 12-07-2007 07:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 01:06 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
Open Source Consulting | Domain Registration