LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   anacron script format (https://www.linuxquestions.org/questions/linux-newbie-8/anacron-script-format-388779/)

kalahari875 12-02-2005 07:30 PM

anacron script format
 
My distro (Kubuntu) organizes by default its cron jobs into folders, such as cron.daily, cron.weekly, etc. and those are scheduled in the crontab. I am trying to add a script to cron.weekly to update my distro that involves issuing three commands. I put them in an executable script file as follows:

apt-get clean
apt-get update
apt-get dist-upgrade -y --purge

When this runs, though, anacron gives the the following error:

/etc/cron.weekly/dist-upgrade:
run-parts: failed to exec /etc/cron.weekly/dist-upgrade: Exec format error
run-parts: /etc/cron.weekly/dist-upgrade exited with return code 1

Any idea what the problem is? I know this is probably something simple.

fsateler 12-02-2005 08:21 PM

First of all, it is a very bad idea to do unattended upgrades: something may go wrong ando you would be left without a clue. As for the script failing, is that the whole script? If it is, the problem may be that cron doesn't use the $PATH you have, so perhaps adding the full path would make it work: /usr/bin/apt-get <command>


All times are GMT -5. The time now is 12:51 AM.