View previous topic :: View next topic |
Author |
Message |
TazG Guru
Joined: 22 May 2004 Posts: 320 Location: Canada
|
Posted: Sat Sep 25, 2004 6:52 pm Post subject: Cron doesn't work |
|
|
I'm trying to use Cron. I have no experience with it. I have vixie-cron, and it is running. I tried to have it start Xine every 5 minutes as a test. I set it up with KCron. Code: | crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/kde-taz/kcronvdbcSb.tmp installed on Sat Sep 25 15:18:41 2004)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# test
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/xine
# This file was written by KCron. Copyright (c) 1999, Gary Meyer
# Although KCron supports most crontab formats, use care when editing.
# Note: Lines beginning with "#\" indicates a disabled task. | What did I miss?? |
|
Back to top |
|
|
inode77 Veteran
Joined: 20 Jan 2004 Posts: 1303 Location: Heart of Europe
|
Posted: Sat Sep 25, 2004 7:12 pm Post subject: |
|
|
I suggest you type crontab -e in your shell. (It should open your default editor and allow you to edit the file including a sanity check after save&quit)
Code: | # minute (0-59),
# | hour (0-23),
# | | day of the month (1-31),
# | | | month of the year (1-12),
# | | | | day of the week (0-6 with 0=Sunday).
# | | | | | commands
# | | | | | |
# | | | | | |
0 10 * * * /usr/bin/rdate -s swisstime.ee.ethz.ch &> /dev/null
# | | | | | |
0 20 * * 3 /usr/sbin/eupdatedb &> /dev/null
# | | | | | |
|
|
|
Back to top |
|
|
TazG Guru
Joined: 22 May 2004 Posts: 320 Location: Canada
|
Posted: Sat Sep 25, 2004 7:44 pm Post subject: |
|
|
It doesn't work with crontab -e either. |
|
Back to top |
|
|
inode77 Veteran
Joined: 20 Jan 2004 Posts: 1303 Location: Heart of Europe
|
Posted: Sat Sep 25, 2004 8:24 pm Post subject: |
|
|
OK let's try some stuff....
1.) Make sure your cron runs
should return a line like this: Code: | root 6557 1 0 12:25 ? 00:00:00 /usr/sbin/cron |
2.) Add this line to your cron using "crontab -e"
Code: | 5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/logger "CRON_TEST" &> /dev/null
|
Check if the crontab has the line added after quiting with
3.) Wait some time and then check your /var/log/messages with
Code: | grep CRON_TEST /var/log/messages | and check the times when and if the messages do appear. |
|
Back to top |
|
|
TazG Guru
Joined: 22 May 2004 Posts: 320 Location: Canada
|
Posted: Sun Sep 26, 2004 3:55 am Post subject: |
|
|
Well that did work - I got "CRON_TEST" in the log every 5 minutes. So, maybe it's only graphical programs that don't start? What if I wanted one to though, what can I do about this? |
|
Back to top |
|
|
hjnenc Veteran
Joined: 15 Aug 2004 Posts: 1599 Location: Vienna, Austria
|
Posted: Sun Sep 26, 2004 8:03 am Post subject: |
|
|
The cron jobs are run whenever the machine is running. It is not necessary that somebody is logged in nor that X is running. It is therefore probably not a good idea to try that. Depending on the program run and the person currently logged in it may also open up security holes.
If you really need to do that, make sure to set up the environment correctly for GUI programs (DISPLAY, XAUTHORITY, ...). |
|
Back to top |
|
|
zurd Apprentice
Joined: 17 Dec 2003 Posts: 228 Location: Canada, Montreal
|
|
Back to top |
|
|
|