#system backup on arch

20 messages · Page 1 of 1 (latest)

remote cloak
#

I'm quite new to arch, so far my system has worked just fine.

But, I have become increasingly worried about how to secure my system if it ever breaks.

I heard timeshift is a good option.

Additionally I manually backup my personal files to a seperate HDD. I wonder if there is a way to automate this process or make it easier, maybe actively mirroring any changes live using syncthing?

I'd appreciate any input for what is reasonable to worry about.

#

Also is it feasable to preconfigure your archinstall based on an existing system configuration? So that I don't have to reconfigure everything if I were to reinstall my os?

safe walrus
#

For offsite backup, you can set up a restic (or rustic) service and a systemd timer to do this automatically.

#
[Unit]
Description=Backup system data
# only run if the backup drive is online and mounted
ConditionPathExists=/dev/disk/by-uuid/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
ConditionPathExists=/media/backup
[Service]
User=backup
Type=oneshot
ExecStart=rustic backup --tag auto /
ExecStartPost=rustic forget --quiet --prune

SyslogIdentifier=rustic-system
# allow the service to read all files
AmbientCapabilities=CAP_DAC_READ_SEARCH
CPUQuota=20%
Slice=background.slice

# security
NoNewPrivileges=true
ReadOnlyPaths=/home
ReadWritePaths=/tmp /run %h/.cache /media/backup
ProtectSystem=true
ProtectProc=noaccess
PrivateTmp=true

timer

# /etc/systemd/system/rustic.timer
[Unit]
Description=Backup system data

[Timer]
OnStartupSec=10m
OnUnitActiveSec=1h

[Install]
WantedBy=timers.target
heavy tartan
mossy forge
#

to be clearer: timeshift et al are for snapshots, which store previous copies of your system on the same drive

#

this is useful for undoing changes, but if the drive dies it all goes poof, so it’s not a real backup

#

as for backing up your files to an HDD, restic is a good suggestion

heavy tartan
#

so does dejadup

mossy forge
#

dejadup just uses restic behind the scenes, doesn’t it?

#

so sure, use that if you’re not familiar with using the CLI

#

as for automating it, unfortunately there’s a trap here

#

if you want to fully automate it the drive has to always be plugged in, which makes it more vulnerable to the various antics you might do on your computer

#

but if you keep it detached most of the time, you will have to remember to plug it in for backups, which makes it not automatic anymore

ashen escarp
#

no, YOU specify the harddrive in timeshift, in my case external drive for backups and snapshots

#

also, you canadd personal folder in timeshift settings aswell as autosnap

mossy forge
#

oh, I didn’t know that actually!

#

in that case timeshift would be a good backup method as well, but you still have to be mindful about when your drive is connected

foggy orbit
ashen escarp
#

timeshift - settings - user - select ALL FILES