To automatically get your Ubuntu up-to-date with the latest upgrades, its a nice idea to place apt-get in crontab.
This can be done as follows:
1. sudo crontab -e
copy this into the file.
30 22 * * * /update-script
2. sudo vim /update-script
and paste this in the file
echo "***************************************" >> /tmp/update.log
date >> /tmp/update.log
echo "......................................." >> /tmp/update.log
apt-get update >> /tmp/update.log
apt-get -y -q --force-yes upgrade >> /tmp/update.log
The first step adds an entry in crontab which will run a script called update-script every day at 10:30PM
The second step is to create the update-script which updates all software in your system. The log of the updates is appended in the file placed in /tmp/update.log.
This can be done as follows:
1. sudo crontab -e
copy this into the file.
30 22 * * * /update-script
2. sudo vim /update-script
and paste this in the file
echo "***************************************" >> /tmp/update.log
date >> /tmp/update.log
echo "......................................." >> /tmp/update.log
apt-get update >> /tmp/update.log
apt-get -y -q --force-yes upgrade >> /tmp/update.log
The first step adds an entry in crontab which will run a script called update-script every day at 10:30PM
The second step is to create the update-script which updates all software in your system. The log of the updates is appended in the file placed in /tmp/update.log.
No comments:
Post a Comment