Barusu - a python tool to back up your apt packages and dconf settings
Usage:
backup_assistant [opts]
Options:
-h --help: show help and exit
-d --backup-dir [directory]: set the directory for the backup/restoration (default is ~/.backups)
-r --restore: run the restoration (from backupdir). You must be root to restore, as you'll install packages. If you are backing up from a directory different from ~/.backup you need to use the -d/--backup-dir option BEFORE the -r/--restore
Installation
After downloading run in the directory you downloaded barusu to: python3 setup.py install
Using with cron/anacron
In a terminal run: crontab -e (you might need to choose an editor to continue)
Once you see your crontab in your editor paste the following line at the end:
0 3 * * * barusu
This will run barusu every 3:00, but if the computer is off, your daily backup is missed.
Alternatively you can set up anacron (usually not installed by default)
How it works:
backup:
- It uses
dpkgto get a list of all installed packages. - It dumps all settings using
dconf - The result is two files in
~/.backup(unless specified otherwise):packagelist.txtanddconf_out.txt(and a hidden.backupdonefile for internal usage of the program
restore: (you must call the script as root when restoring!)
- It uses
dpkgto set a list of operations exported in~/.backup/packagelist.txtthen callsapt-getto install them - It uses
dconfto load settings exported in~/.backup/dconf_out.txtIt is possible to provide an alternative backup folder using option-dorbackup-diras with backups, but you need to specify the folder BEFORE the-r/--restoreoption