Hi, guys,
I had been writing a tool to backup important system files and folders immediately after they changed. It works pretty well, has helped me in a few new installs, but to be safe I consider it still beta.
It comes with very detailed instructions; they might be helpful in an already stressful situation. The scripts are extensively commented.
Because I switched distro and have no need for it any more, I have abandoned the project. Does anyone want to take it up? (You’ll quickly get used to that peculiar code style, I’m certain.) ![]()
Take packliback and do whatever you want.
Download here, 28.5k.
EDIT: Link working now. I hope.
Below is the README, if you’re still curious.
==============================================
MAINTAINER WANTED
I’ve stopped working on it. Grab it, adopt, adapt, and improve!
THIS IS A BETA VERSION
Although it already works well, it’s best to not rely solely on packliback.
[Beta testers wanted] Criticism and suggestions are very welcome. What needs to be improved, or added?
[Better name wanted] Suggestions for a better name are welcome. The current name came from its early function, package list backup, but it sounds too much like a Swiss order to bake small parcels.
PACKLIBACK
Packliback makes the setup of a (nearly) identical system easier.
It backs up from the machine it runs on, and allows individual installations on a target machine, of:
- a list of installed packages, and several subsets of it,
- a list of installed flatpaks,
- a list of installed snaps,
- the local pacman database,
- network settings,
- the
hostsfile, - the contents of
fstabandcrypttab.
It runs as a set of systemd services on startup. Whenever the above directories or files have changed, it will create a backup.
Instructions and scripts to restore/install the listed packages/flatpaks/snaps are included with the backups.
The individual backups can be run manually with the corresponding /etc/packliback.d/packliback-XXXX.script.
Security warning:
The backups may contain sensitive data in cleartext. They may be compromised if the backups were not always kept in an encrypted place. Also beware of shadow copies or stored version when working on a backed-up file.
Networkmanager: If connection passwords were stored “for all users (not encrypted)”, they will appear in cleartext in the backup. It might be a better solution to store them “for this user only (encrypted)” and allow all users to use the connections. Or set up each user individually.
Crypttab: Could contain passwords. Better use a keyfile that is backed up with the system (hopefully in an ecrypted container).
Hosts file: Blindly installling a host list is a security risk! Make sure it is not manipulated (e.g., backup a hashsum elsewhere and keep it up to date), or check it before installation.
Notes:
- The restore scripts will install the default for an item name – usually the latest versions from the
stablebranches. If version, origin, active or latest commit matter, edit the backup list before restoration. - Packliback backup files that have been backed up again elsewhere may have been given the
mtimeof the restore (depends on the backup application). If ‘keep_days’ is set (seepackliback.conf), they will be removed at the time calculated from thatmtime, not from their creation.
Install packliback
-
Please make sure that your system fulfills the prerequisites to work with AUR, flatpaks, and snaps. More info in the Arch Wiki: AUR, Flatpak, Snap.
-
Download the files and decompress, or clone the repo.
-
Set the path of the target directory for the backups in
packliback.conf. This is mandatory, the other parameters there are optional. -
Run the install script from the packliback directory:
$ cd <path/to/packliback/directory>
$ sudo ./install.bash
The install script will install its files, enable packliback (which triggers a first run), and check the status of the newly installed systemd *.service and *.path.
Check if it works
After the next installation, update, or removal on your machine, check again to make sure that the service was run when the pacman, flatpak, or snap installation changed.
Or compare the fresh directory in the target directory with the last one from before the change.
To manually check the status of all packliback services and paths, run
$ systemctl status $(ls /etc/systemd/system/ | grep -E 'packliback.*\.service')
$ systemctl status $(ls /etc/systemd/system/ | grep -E 'packliback.*\.path')
Installed files
/etc/packliback.d/
/etc/packliback.d/packliback-0-config.conf
/etc/packliback.d/packliback-1-preparations.script
/etc/packliback.d/packliback-2a-pacman.script
/etc/packliback.d/packliback-2b-flatpak.script
/etc/packliback.d/packliback-2c-snap.script
/etc/packliback.d/packliback-3-hosts.script
/etc/packliback.d/packliback-4-networkmanager.script
/etc/packliback.d/packliback-5-fstab-crypttab.script
/etc/packliback.d/packliback-6-cleanup.script
/etc/packliback.d/packliback-uninstall.bash
/etc/packliback.d/RESTORE.tar.xz
/etc/systemd/system/packliback-2a-pacman.path
/etc/systemd/system/packliback-2a-pacman.service
/etc/systemd/system/packliback-2b-flatpak.path
/etc/systemd/system/packliback-2b-flatpak.service
/etc/systemd/system/packliback-2c-snap.path
/etc/systemd/system/packliback-2c-snap.service
/etc/systemd/system/packliback-3-hosts.path
/etc/systemd/system/packliback-3-hosts.service
/etc/systemd/system/packliback-4-networkmanager.path
/etc/systemd/system/packliback-4-networkmanager.service
/etc/systemd/system/packliback-5-fstab-crypttab.path
/etc/systemd/system/packliback-5-fstab-crypttab.service
Remove packliback
Run the uninstall script.
$ sudo ./uninstall.sh
Credits
Packliback grew from a fork of pakbak (GitHub) (AUR) by Giuliano Schneider