Problems with cron
I am running SUSE 10 on my linux box at home, and recently I have added a second NIC so that I can use it as a router. I now I want to disable eth1 at midnight and reenable it at 8am. I am trying to use cron to do this, so I logged in as root and used the crontab -e to add the following:
# DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.XXXX37iRWq installed on Wed Feb 7 06:48:39 2007) # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $) 50 2 * * 0-5 cat /root/messages/warning.txt | smbclient -M VESPER 00 0 * * 0-5 ifdown eth1 00 8 * * 0-5 ifup eth1 I have tested this several times and it does not appear to work. I at this point I am at a loss. Can someone point me in the right direction? |
First you can check the standard error from cron jobs, which is sent to system mail by default. If you have edited crontab as root, type simply mail at the command line and see if any message has been sent from crond. Another hint is to put the full path of the commands in the crontab, since crontab itself has a very limited PATH by default, e.g.
Code:
00 8 * * 0-5 /sbin/ifup eth1 Code:
date > /root/cron.log Code:
ps -u root | grep crond |
Thanks for the help
I put the complete path to ifup and ifdown into my crontab and that took care of the problem. Thanks for your help.
|
Quote:
Code:
man 5 crontab |
All times are GMT -5. The time now is 03:14 AM. |