LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-14-2007, 06:24 PM   #1
gohmifune
Member
 
Registered: Nov 2006
Distribution: Ubuntu
Posts: 42

Rep: Reputation: 15
Cron Scheduling isn't working for me, can someone walk me through this?


I have tried this on Ubuntu, now I'm in Fedora, and it isn' working. This is a very needed feature. Can someone go through the automated launching of liferea, evolution, and firefox everyday at 1145pm? I think I need the exact commands to type in terminal or put in gnome-schedule. Online tutorials aren't helping me fix this.

First I think in need to know in Fedora how to make sure crond is launching.
 
Old 08-14-2007, 06:55 PM   #2
thebouv
Member
 
Registered: Aug 2007
Distribution: RHEL, Fedora, Ubuntu
Posts: 64

Rep: Reputation: 16
Edit your personl crontab do this:

Code:
crontab -e
Then you'll add these lines:

Code:
45 23 * * * /path/to/evolution
45 23 * * * /path/to/firefox
45 23 * * * /path/to/anythingelse
The reason it might not have worked using your crontab file or gnome-schedule is that you were perhaps not using military time?

Handy diagram btw:

Code:
# Use the hash sign to prefix a comment
# +---------------- minute (0 - 59)
# |  +------------- hour (0 - 23)
# |  |  +---------- day of month (1 - 31)
# |  |  |  +------- month (1 - 12)
# |  |  |  |  +---- day of week (0 - 7) (Sunday=0 or 7)
# |  |  |  |  |
# *  *  *  *  *  command to be executed
 
Old 08-15-2007, 01:33 AM   #3
gohmifune
Member
 
Registered: Nov 2006
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: 15
Thank you very much for the response. I tried launching liferea with

25 01 * * * /usr/bin/liferea

nothing happened. That should be the correct format, Did it early enough so that the daemon would catch it, but nothing. The daemon should start, but is there a way to make sure it is running, or anything else I should look for?
 
Old 08-15-2007, 10:38 AM   #4
thebouv
Member
 
Registered: Aug 2007
Distribution: RHEL, Fedora, Ubuntu
Posts: 64

Rep: Reputation: 16
Check your cron log: /var/log/cron.log

Though, since you asked how to make sure cron is even running:

ps ax | grep cron

Should see a line that says: /usr/sbin/cron
 
Old 08-16-2007, 07:50 PM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
It is a problem about the execution of X applications from crontab: in the cron environment the DISPLAY variable is not defined, so when you launch a X application you will likely get the error "cannot connect to X server". A way to solve this is to launch your application with the env command, like:
Code:
25 01 * * * env DISPLAY=:0 /usr/bin/liferea
assuming you want to launch liferea by connecting to display :0 and assuming you have the proper permissions. You can check the environment variable $DISPLAY and set the display number accordingly.
 
Old 08-16-2007, 08:12 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
colucix is right about setting the DISPLAY variable - here are a couple of examples I use here for changing the background image when I'm connected locally (display :0.0) or via VNC (display :1.0):
Code:
0-59 * * * * (DISPLAY=:0.0 /usr/X11R6/bin/fbsetbg -r /home/steve/.fluxbox/backgrounds 2>/dev/null)
0-59 * * * * (DISPLAY=:1.0 /usr/X11R6/bin/fbsetbg -r /home/steve/.fluxbox/backgrounds 2>/dev/null)
 
  


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
LXer: Linux tip: Job scheduling with cron and at LXer Syndicated Linux News 0 07-21-2007 03:16 AM
scheduling poweroff using cron akudewan Ubuntu 2 11-17-2005 04:00 AM
cron scheduling and time change dsschanze Linux - General 3 11-13-2005 04:22 PM
scheduling monthly job in cron from debian sarge 3.1 sridhar11 Debian 2 10-28-2005 09:03 AM
Problems scheduling jobs with cron ferrantepunto Linux - General 5 01-24-2003 07:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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