View previous topic :: View next topic |
Author |
Message |
No_Code n00b
Joined: 14 Sep 2004 Posts: 8
|
Posted: Wed Dec 08, 2004 5:41 pm Post subject: Vixie-Cron Not Executing Jobs |
|
|
Hi all. I'm kind of new to the whole world of cron jobs and such. I was following the Gentoo Cron Daemon Howto that is found in the Gentoo Documentation section. I emerged Vixie-Cron when I was getting the system together, but I had never really used it. I attempted to add a few routine cron jobs to it using Webmin (i.e., emerge sync, reboot, emerge --pretend --update world), but none of them ever ran. So I figured that something was wrong with Webmin and I tried to add them via the console. Turns out, Webmin did add the cron jobs properly, but they were not being executed. Following the Gentoo Cron Daemon Howto, I added the following job as an experiment to see if things were running:
Code: |
10 3 1 1 * /bin/echo "i don't really like cron"
30 16 * 1,2 * /bin/echo "i like cron a little"
* * * 1-12/2 * /bin/echo "i really like cron"
|
And none of them would actually run. Running rc-status indicates that the daemon is actually running. On a side note, I have restarted vixie-cron countless times.
Code: |
release crond # rc-status
Runlevel: default
dhcp [ started ]
sshd [ started ]
local [ started ]
vixie-cron [ started ]
iptables [ started ]
domainname [ started ]
metalog [ started ]
net.eth1 [ started ]
netmount [ started ]
webmin [ started ]
openvpn [ started ]
|
My /etc/crontab file looks like the following:
Code: |
# for vixie cron
#
# $Header: /var/cvsroot/gentoo-x86/sys-apps/vixie-cron/files/crontab-3.0.1-r4,v 1.6 2004/07/18 04:40:50 dragonheart Exp $
#
#
# Global variables
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
0 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly
1 3 * * * root rm -f /var/spool/cron/lastrun/cron.daily
15 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly
30 5 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly
*/10 * * * * root test -x /usr/sbin/run-crons && /usr/sbin/run-crons
|
I am running Vixie-Cron 4.1-r4. Am I doing something wrong here or is the issue more in-depth? I've been searching the forums to try to find some answers and see if anybody has ever had issues like these before, but I haven't been able to find much. Thanks in advance to anyone who can help! |
|
Back to top |
|
|
hoochiepapa Tux's lil' helper
Joined: 02 Oct 2002 Posts: 105
|
Posted: Wed Dec 08, 2004 5:56 pm Post subject: |
|
|
your command /usr/bin/echo .........
has nowhere to echo except to var/log/messages
did you look there?
vixie-cron can run scripts placed into /etc/cron.daily, weekly, hourly,monthly
create a simple shell script that runs emerge --sync
drop it into /etc/cron.daily.
make sure it is executable.
under cron stdout is usually /var/log/messages
your emerge -pu world would dump its output in messages. |
|
Back to top |
|
|
No_Code n00b
Joined: 14 Sep 2004 Posts: 8
|
Posted: Wed Dec 08, 2004 6:32 pm Post subject: |
|
|
There is nothing in /var/log/messages. I also looked in /var/logs/everything/current. Nothing. As for emerge -Up world, I realize that it would just output messages. For the sake of brevity, I didn't include the > filename.txt portion. |
|
Back to top |
|
|
hoochiepapa Tux's lil' helper
Joined: 02 Oct 2002 Posts: 105
|
Posted: Sat Dec 11, 2004 3:35 am Post subject: |
|
|
I just tried a simple cron without any problems
post the output of crontab -l and ls -l /var/spool/cron/crontabs/ |
|
Back to top |
|
|
Bigun Advocate
Joined: 21 Sep 2003 Posts: 2196
|
Posted: Fri Dec 17, 2004 8:08 pm Post subject: |
|
|
Having the same issue, here's my crontab:
Code: |
mailto=root
# min hour date month dayofweek command
0 1 * * * emerge sync && emerge -u world && shutdown -h now
|
Except when I come in the morning, my computer is still on at work. Ideas? _________________ "It's ok, they might have guns but we have flowers." - Perpetual Victim |
|
Back to top |
|
|
hoochiepapa Tux's lil' helper
Joined: 02 Oct 2002 Posts: 105
|
Posted: Sat Dec 18, 2004 2:07 am Post subject: |
|
|
bigun89 wrote: | Having the same issue, here's my crontab:
Code: |
mailto=root
# min hour date month dayofweek command
0 1 * * * emerge sync && emerge -u world && shutdown -h now
|
Except when I come in the morning, my computer is still on at work. Ideas? |
/sbin is not in the default path
try changing your command to to /sbin/shutdown |
|
Back to top |
|
|
BlackEdder Advocate
Joined: 26 Apr 2004 Posts: 2588 Location: Dutch enclave in Egham, UK
|
Posted: Sat Dec 18, 2004 9:29 am Post subject: |
|
|
and make sure vixie-crom is started |
|
Back to top |
|
|
Bigun Advocate
Joined: 21 Sep 2003 Posts: 2196
|
Posted: Sun Dec 19, 2004 2:17 pm Post subject: |
|
|
hoochiepapa wrote: | bigun89 wrote: | Having the same issue, here's my crontab:
Code: |
mailto=root
# min hour date month dayofweek command
0 1 * * * emerge sync && emerge -u world && shutdown -h now
|
Except when I come in the morning, my computer is still on at work. Ideas? |
/sbin is not in the default path
try changing your command to to /sbin/shutdown |
What's odd is the rest of the commands are being executed, it skips the shutdown command.
And yes vixie-cron is started, it's on the default runlevel. _________________ "It's ok, they might have guns but we have flowers." - Perpetual Victim |
|
Back to top |
|
|
stahlsau Guru
Joined: 09 Jan 2004 Posts: 584 Location: WildWestwoods
|
Posted: Sun Dec 19, 2004 4:52 pm Post subject: |
|
|
I didn´t get this to work as well. Then i deleted every cron.* and crontab from /etc, did "crontab -e" and added the jobs, et voila, everything went ok.
I´m using anacron for the jobs and dcron to call anacron (i start anacron as boot-service, which executes all my tasks. Only problem: if my system stayed up over night, the other day anacron wasn´t rerun (since there was no booting this day). So i emerged dcron to start anacron every night at 04:00 (of course it wouldn´t start anacron if my box is down over night, only if it´s up ) |
|
Back to top |
|
|
hoochiepapa Tux's lil' helper
Joined: 02 Oct 2002 Posts: 105
|
Posted: Sun Dec 19, 2004 5:26 pm Post subject: |
|
|
bigun89 wrote: | hoochiepapa wrote: | bigun89 wrote: | Having the same issue, here's my crontab:
Code: |
mailto=root
# min hour date month dayofweek command
0 1 * * * emerge sync && emerge -u world && shutdown -h now
|
Except when I come in the morning, my computer is still on at work. Ideas? |
/sbin is not in the default path
try changing your command to to /sbin/shutdown |
What's odd is the rest of the commands are being executed, it skips the shutdown command.
And yes vixie-cron is started, it's on the default runlevel. |
/usr/bin is in the default path.
It's best to write scripts to do your jobs, then cron the script.
That way, there are no question on your env.
If you must run individual commands, specify the full path to the command. |
|
Back to top |
|
|
|