Small Python script that tries to update an Arch Linux system (by running pacman -Syu --noconfirm
) and send update notifications via e-mail in case of failure. Needs Python >3.5, cower and pacman.
Firstly, install cower (optional) if you want AUR updates notification.
Secondly, open auto_upgrade.py
and modify according your necessities (at least you need to modify EMAIL
and PASSWORD
variables).
Afterwards, copy auto_upgrade.py
to /root
(or any other directory with 700 permission for root, so a normal user can't read your password in plain text!) and auto_upgrage.service
and auto_upgrade.timer
to /etc/systemd/system
.
Finally enable the timer service by running:
# systemctl enable auto_upgrade.timer
That's it.
Not providing a setting to disable auto-upgrades is kind of irritating for someone like me who just wants email notifications. I also would write a PKGBUILD for this script, but every time I would use it the settings would be overwritten since they are tied into the code. Using an external file for settings would be more sufficient. Settings for custom update commands for official repositories and AUR would also be handy. The password could be encrypted through python-keyring or other means for those who don't use keyring. One more thing: email_updates would be a better name for this script if my suggestions were applied.