A convenient way to maintain the test environment is automatic updating.
However, remember to set the backup, e.g. the day before – I always set it like that in proxmoxe.
The script that updates the Debian system looks like this:
1 2 3 4 5 6 |
# cat /root/update.sh #!/bin/bash apt-get update apt-get upgrade -q -y apt-get autoremove -y -q rm -rf /var/cache/apt/archives/*.deb |
You can download the script from:
1 2 |
$ cd /root/ $ wget https://soban.pl/bash/update.sh |
The script cleans unnecessary deb files after the update.
Keep in mind the permissions and capabilities of the script:
1 |
# chmod +x /root/update.sh |
In crontab, I set the day after automatic backup in proxmoxe:
1 |
10 4 * * 3 /root/update.sh > /dev/null 2>&1 |
Of course, the script can be added in the production environment, but it should not be added to the crontab.