Skip to content

Instantly share code, notes, and snippets.

@zachsmith
Last active January 18, 2020 17:08
Show Gist options
  • Save zachsmith/bd9ad78be09fbfd38d0c5bdc66cc7196 to your computer and use it in GitHub Desktop.
Save zachsmith/bd9ad78be09fbfd38d0c5bdc66cc7196 to your computer and use it in GitHub Desktop.
Backup list of packages installed on Arch
Install the following files in ~/.config/systemd/user to backup a list of packages installed via pacman.
I copy to Nextcloud so I have a remove copy in case I need to reinstall.
---
# backup-package-list.timer
[Unit]
Description=Create a list of installed packages
Documentation=Make a backup of packages installed with pacman right after login and then once per day
[Timer]
OnStartupSec=45
OnUnitActiveSec=1d
[Install]
WantedBy=default.target
---
# backup-package-list.service
[Unit]
Description=Backup list of packages installed by pacman
[Service]
Type=oneshot
StandardOutput=file:%h/Nextcloud/Backups/%H/packages.txt
ExecStart=pacman -Qqe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment