Bojan
Posts: 17
Joined: Sun Nov 08, 2015 6:55 am
Location: Slovenia
Contact: Website

On simple cron help about upgares and reboot

Sat Feb 27, 2016 5:06 pm

So I found this command:

Code: Select all

0 7 * * 1 apt-get update && sudo apt-get upgrade -y
What to add to it, that it will reboot after each update?

And one more, what is that -y at the end?

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: On simple cron help about upgares and reboot

Sat Feb 27, 2016 7:48 pm

Bojan wrote:So I found this command:

Code: Select all

0 7 * * 1 apt-get update && sudo apt-get upgrade -y
What to add to it, that it will reboot after each update?

Code: Select all

0 7 * * 1 apt-get update && sudo apt-get upgrade -y && reboot
Bojan wrote:And one more, what is that -y at the end?
It means that it won't ask you if you want to install upgrade, it'll just do it.
From the man page
-y, --yes, --assume-yes
Automatic yes to prompts. Assume "yes" as answer to all prompts and run non-interactively. If an undesirable situation, such as changing a held package or removing an essential package, occurs then apt-get will abort.

Bojan
Posts: 17
Joined: Sun Nov 08, 2015 6:55 am
Location: Slovenia
Contact: Website

Re: On simple cron help about upgares and reboot

Sat Feb 27, 2016 9:47 pm

Thank you :)

Return to “Beginners”