Package: enacrestic
ENACresticA simple Qt GUI to automate backups withresticAutomate yourresticbackups at a choosen frequencyRunrestic forgetin a regular basis (and transparently) to keep your backup light and usefulLet you see when:pre_backupscript is runningrestic backupis runningrestic forgetis runningrestic unlockis runningbackup is completedlast operation failedlast backup failed because of a network timeout (maybe the VPN is not running?)InstallationThis has been tested and validated onUbuntu 18.04 LTSUbuntu 20.04 LTSUbuntu 22.04 LTSsudoaptinstallresticpython3-pipqt5dxcb-pluginpython3-pyqt5
pip3install--user--upgradepip
pip3install--userenacresticUpgradeTo upgrade ENACrestic to latest release, just run the following command:pip3install--user--upgradeenacresticConfig ENACresticNote: For this documentation, we have chosen to use thevitext editor.
Adapt the commands below by replacing it with the editor of your choice. (nano,gedit, ...)mkdir~/.enacresticWrite environment setup fileChoose the right section according to your destination storagevi~/.enacrestic/env.sh# 1. recommended destination: S3 Bucket
export RESTIC_REPOSITORY=s3:s3.epfl.ch/bucket_name/restic_MyComputerName
export AWS_ACCESS_KEY_ID=TheBucketRWAccessKey
export AWS_SECRET_ACCESS_KEY=TheBucketRWSecretKey

# 2. alternative destination: SSH / SFTP
export RESTIC_REPOSITORY=sftp:my-server.epfl.ch:/home/username/pathNote, although Restic is able to manage several computers being backed up on a same respository, it's not recommended with ENACrestic. Keep a dedicatedRESTIC_REPOSITORYper machine.Write password file (mandatory)Add a one line password in it. This is used to encrypt your backups.vi~/.enacrestic/.pwBe careful ! If you loose this password ... you loose your backups.Define what to backup (mandatory)Add one line per folder / file that has to be backed up.vi~/.enacrestic/bkp_include# 1. recommended scenario: backup all your home directory
/home/username/

# 2. alternative scenario: backup only choosen folders
/home/username/.enacrestic/
/home/username/Documents/
/home/username/Teaching/
/home/username/Pictures/
/home/username/Projects/
/home/username/Learn/
/home/username/.gitconfig
/home/username/.mozilla/
/home/username/.ssh/
# heavy !
/home/username/Videos/note: Lines starting with a#are ignored.Define what to exclude from the backup (optional but recommended)Add one line per folder / file / expression that has to be excluded.Before running your first backup, you might want to exclude heavy and unnecessary folders (Like the Downloads or the Trash). You can use thebaobabutility to find those.Here is an example of some typical things you might want to exclude from backup:vi~/.enacrestic/bkp_exclude*.iso
*.sav
*.bak
*.bak2
*.log
*.ost
*.part
*.temp
*.tmp
*.vhd
*.vhdx
*.vmdk
*.vdi
/home/username/Downloads/
/home/username/ENACdrives/
/home/username/.local/share/Trash/
/home/username/VirtualBox VMs/
/home/username/snap/
/home/username/.cache/
/home/username/**/nobackup*
/home/username/.local/share/virtualenvs/
/home/username/.arduino15/
/home/username/.atom/
/home/username/.npm/
/home/username/.nvm/Exact syntax is describedhereMake it available to your shell (mandatory)Add the following 2 lines to have:enacrestic in your$PATHenacrestic's env variables available.vi~/.bashrc# or ~/.zshrc or whatever is your shell rc fileexport "PATH=$PATH:$HOME/.local/bin"
. $HOME/.enacrestic/env.shNow close + open a new terminal to get it all into your environment ... or simply reload your rc file:.~/.bashrc# or ~/.zshrc or whatever is your shell rc fileAll done !🎉 Setup is now complete! You're now ready to send your 1st backup. 🎉RunENACresticon your computerfrom Ubuntu's Application launcheror from command line with the single commandenacresticYou'll see a new icon in the system tray (upper-right corner of your screen) with following icon.This is the indicator that ENACrestic is running in the background and it'll change over time, reflecting current state.By clicking on it, you can view detailed status and opt-in for the auto-start feature (startENACresticwhen Ubuntu user session is started).From now on, ENACrestic is running in the background and doing the backups on a regular basis.You can check it's activity by reading the~/.enacrestic/last_backups.logfile.Note:First backup can take a long time!Please consider having enough time for the 1st backup to complete. It'll be the longest backup ever, since everything has to be copied. All future backups will then be only incremental.RunENACresticon a serverAdd a dedicatedSystemdservice file:vi/etc/systemd/system/enacrestic.service[Unit]
Description=ENACrestic

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
User=root
Group=root
WorkingDirectory=/root
ExecStart=/root/.local/bin/enacrestic --no-gui
KillSignal=SIGTERM
Restart=on-failure
RestartSec=30Enable and start it:systemctldaemon-reload
systemctlenableenacrestic.service
systemctlstartenacrestic.serviceThat will ensure enacrestic service is started when the server boot.You can know its status with the following commands:systemctlstatusenacrestic.service
tail-n50-f/root/.enacrestic/last_backups.logNote on old backups retention policyBy default, every 10 backups, arestic forgetwill clean repository from backups that don't need to be kept, according the following retention policy:keep the last3backupskeep the last24hourly backupskeep the last7daily backupskeep the last4weekly backupskeep the last12monthly backupskeep the last5yearly backupsWhat ENACrestic doesn't doENACrestic is here to help you, running backups on a regular basis. If you want to browse backups, restore files/folders, you'll have to useresticitself. Here are basic commands:List the snapshots (backups)resticsnapshots-c--password-file~/.enacrestic/.pwMount the backups ...... and be able tobrowse the different snapshotsrestore any file / foldermkdir-p~/mnt/my_backups
resticmount~/mnt/my_backups--password-file~/.enacrestic/.pwNow you can browse~/mnt/my_backupsfolder and copy from it anything you want to restore. When done, you can simplyCtrl-cin the terminal where you had issued therestic mount ...command.