Cron ignoring changes made in file
Hi,
i have a small problem on my system... I recently wrote a small bash script and added it via crontab -u root -e and it's executed as it should. Then a few days after i did edit my bash script, but once it is run by cron it doesn't reflect the changes i made to the script. I did manually restart crond, tryed sync, moved my script, renamed it even rstart the server - no success. If i run my script manually it returns me the expected output. part of my script (/root/sd.sh): Code:
#!/bin/sh Code:
root@monster:~# crontab -l Code:
Mar 21 09:10:01 monster /USR/SBIN/CRON[3998]: (root) CMD (/root/sd.sh | logger) Code:
root@monster:~# sh /root/sd.sh regards Pat |
Normally you should not have to restart cron or anything. Cron reads the script on every invokation.
The problem is not obvious to me, but here are a few thoughts on how to debug it: - I see that you manually invoked it with "sh /root/sd.sh"... Why not "/root/sd.sh"? That does not make it 100% comparable to the cron entry. Is your script executable at all? If it isn't, run Code:
chmod +x /root/sd.sh Code:
touch /tmp/cron.test - Are you sure that everything was done under root? Maybe something is lying around in a user crontab? - Note that you only have a very limited $PATH variable content in the cron environment. If your script calls other scripts (tw-cli ?) it's best to call them with their full path. - Consider echoing the contents of your variables to a text file to check what they get assigned to. Maybe that'll give you a hint on what goes wrong. |
Hi, thank you for the hints - you were right, it's not cron ignoring my code, it's the issue in the script, especially what you pointed out below:
Quote:
fyi, tw-cli is the cmd line interface for my 3ware hardware raid controller. thank you very much regards Pat |
You are welcome, glad that you've been able to get it working
|
All times are GMT -5. The time now is 05:19 PM. |