Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-02-2005, 07:30 PM   #1
Registered: Apr 2004
Distribution: Kubuntu 6.06 (Dapper)
Posts: 32

Rep: Reputation: 15
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:

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.
Old 12-02-2005, 08:21 PM   #2
Registered: Jul 2004
Location: Santiago, Chile
Distribution: Debian Unstable
Posts: 107

Rep: Reputation: 15
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>


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
A script to convert maildir to mailbox format i_s Linux - General 7 12-14-2009 03:20 PM
anacron not running CarLash Mandriva 0 05-25-2005 08:36 PM
anacron startscript juli SUSE / openSUSE 2 05-01-2005 01:51 PM
Shell script ip address format check. rooch84 Linux - Software 6 08-18-2004 09:14 AM
Bulk image format conversions with a shell script? infidel Linux - Software 4 11-16-2003 07:20 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:45 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration