Welcome to 96MB, please Login or Create an account to get full access to the forums.
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

apt-get via cron not working?

Offline zhuanyi Posted 08-16-2013, 11:22 PM -
Post: #1
Senior Member
357 Posts
Reputation: 5
I have a very simple apt-get script that has a one line code like:

apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade

And I have set it up via cron to run every evening, using crontab -e:

0 3 * * * /root/apt.sh

However when I ran the script manually after a month or so, I get over 50 package updates, which seems to show that the cron did not work properly.

What I can confirm so far:

1. The script is working when running manually
2. The cron is working since I had other cron jobs running and they all seem to work

I am on Debian 6.

Anyone could help?
Back to top Find Quote
Offline tmn29a Posted 08-26-2013, 09:36 PM -
Post: #2
Resistance Leader
83 Posts
Reputation: 1
Can't find the problem, but why do you "apt-get -y upgrade && apt-get -y dist-upgrade" ?
Back to top Find Quote
Offline zhuanyi Posted 08-26-2013, 09:59 PM -
Post: #3
Senior Member
357 Posts
Reputation: 5
(08-26-2013, 09:36 PM)tmn29a Wrote: Can't find the problem, but why do you "apt-get -y upgrade && apt-get -y dist-upgrade" ?

Sorry....but why not? Smile

You mean why the -y part of why the upgrade/dist-upgrade part?
Back to top Find Quote
Offline tmn29a Posted 08-26-2013, 11:14 PM -
Post: #4
Resistance Leader
83 Posts
Reputation: 1
I mean why update and then dist-upgrade ?

From the man pages :

Code:
dist-upgrade
    In addition to performing the function of upgrade, this option also intelligently handles changing dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones, if necessary.

Which means, that dist-upgrade does everything and upgrade is redundant !
Back to top Find Quote
Offline zhuanyi Posted 08-26-2013, 11:19 PM -
Post: #5
Senior Member
357 Posts
Reputation: 5
(08-26-2013, 11:14 PM)tmn29a Wrote: I mean why update and then dist-upgrade ?

From the man pages :

Code:
dist-upgrade
    In addition to performing the function of upgrade, this option also intelligently handles changing dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones, if necessary.

Which means, that dist-upgrade does everything and upgrade is redundant !


Interesting...I was always under the impression they do something different because when I runs upgrade followed by dist-upgrade, I get quite a few packages to upgrade...

Guess now I learnt something new today Smile

But I guess the issue here is apt just does not seem to run via Cron at all. Like nothing was updated even though other cron jobs runs on a daily basis.
Back to top Find Quote


Forum Jump:

User(s) browsing this thread
1 Guest(s)

© 2012 96MB

Community software by MyBB

Premium Theme by ThemeFreak