Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
why cronjob doesn't work
Name: michael Date: December 5, 2001 at 12:24:22 Pacific
Comment:
I am just wondering why the cronjob in linux system doesn't work. I run the script it works fine, but if I add script to crontab it fails to run. (00 12 * * * /usr/local/scriptname 1>/dev/null 2>/dev/null), I double check the permission of script, it's correct. Does anybody have solutions?
Name: danny Date: December 5, 2001 at 14:54:39 Pacific
Reply:
Make sure to specify the full path for any commands in your script.
EX: "/usr/sbin/useradd" instead of "usradd"
0
Response Number 2
Name: John Date: December 5, 2001 at 17:03:07 Pacific
Reply:
Make sure that the crond is running:
ps ax |grep crond
0
Response Number 3
Name: michael Date: December 5, 2001 at 17:17:44 Pacific
Reply:
Crond is running at deamon, I can also use "admin" login to run crontab, however if I use "root" to run crontab, it fails, don't know what's happen.(I use full path, and the script works fine if I run it from command line)
0
Response Number 4
Name: Mik Date: December 6, 2001 at 01:06:59 Pacific
Reply:
What is failing to work? Does the script itself not start or some commands in the script are failing to run? When you run it in a shell you'll normally have environment variables set. When you run it from the crontab you won't have all the same environment variables. So you'll either have to set them in the crontab file or in the script itself. Try making the script do something simple like /bin/date >> /dir/scriptdate or something else which you know will always work.
Mik
0
Response Number 5
Name: danny Date: December 6, 2001 at 06:25:15 Pacific
Reply:
take a look to the /var/log/cron and make sure the process is executed as per the schedule. If there is really an error in teh script, it should appear in your email.
Summary: a linux 2.2.14 + squid 2.3 + ip_wccp.o module //router with ios 12.0(7) in /etc/squid/squid.conf httpd_accel_host virtual httpd_accel_port 80 httpd_accel_with_proxy on httpd_accel_uses_host_header on...
Summary: I recently installed RedHat 8.0 and got a problem with my SoundBlaster awe 64 value (ISA port). Kudzu did find my sound card and installed drivers. Everything worked fine until I went to X. There, the...
Summary: When I attempt to print to my Epson printer on this machine (it prints ok when request is not going through samba), it simply fails to print anything. I can still access shares on this machine. He...