script for cron

Soldato
Joined
3 Dec 2002
Posts
4,065
Location
Groovin' @ the disco
Hi

I've setup a script to update a few apps on my server, then added it to my crontab, after testing it was all fine.
I forgot to add the reboot command at the end of the script, so I went in and edited the script file and saved it.

running the script manually works fine with the reboot at the end, but cron seems to be running the older version of the script without the reboot.

I've tried rebooting the server manually, and stoping and restarting the cron service.. but it's still not picked up the changed script.

I've just tried editing the cron job itself, with sudo crontab -e and saving the file, would that make the cron run the new version of the script?
It's a weekly run job, so I guess I have to wait a week to find out..
 
Cron will run the version on disk. Have you maybe pointed cron to a different older file? It'd help if you post the script and cron entry.
 
Could be an issue with the script itself, typically scripts running under cron have a different environment

The common problem is that you haven't got absolute paths set eg

reboot

May be

/usr/sbin/reboot

etc

To find the absolute paths use

root@prox-u24:~# which reboot
/usr/sbin/reboot
 
Last edited:
Back
Top Bottom