Backup - Restore

How can I do a backup and after restore it?

Foris, under “maintenance” section, have a option for do a backup or restore it. But only do backup of “/etc/config” I also need to backup of for example “/etc/openvpn”, etc.

LuCi, always had a option for do a backup or restore it (and customizable). But now I can not find it.

For now I am using (“/etc/sysupgrade.conf”):

sysupgrade --create-backup /tmp/backup-`cat /proc/sys/kernel/hostname`-`date +%F`.tar.gz

The LuCI option to backup and restore is gone, because it relied on the use of RO squash FS + overlayFS on top of that (something may have changed from the time of the first turris when we disabled that). Omnia doesn’t use that, so it didn’t work anyway. I’m not sure if the sysupgrade works with the same assumptions.

However, you can just do tar c /etc/dir1 /etc/dir2 | bzip2 >file.tar.bz2. The foris restore will happily eat that as long as it does contain /etc/config. Anything additional will be unpacked as well. But it may make some sense to have the list of directories for Foris’ backup configurable.

Anyway, doing local backups probably doesn’t make much sense. The router does btrfs snapshots, so you can go back in history. You have the original available even after factory reset, so you can just ssh into the router and dig around and copy the old configs over (with a bit of skill, of course).

Of course, doing remote backups still makes sense, in case of HW failure or broken filesystem.

1 Like

Sysupgrade seems work the files are there, in the generated tar.gz. Foris’ backup configurable seems util. But I didn’t know about of btrfs snapshots, I will to see about it.

Thanks.

do the snapshots contain all of the files? also manually created ones, etc. or just config directories and installed packages?

same questions what files from snapshots contains?

I’m disappointed that Turris support hasn’t answered you guys. But the help is here:

https://www.turris.cz/doc/en/howto/schnapps

And you can mount any snapshot in /mnt and explore it. I did a cursory look and it seems to be a snapshot of thw whole root file system, all of it with the exception of /var and /tmp (and I suspect that’s because they are not on the btrfs but on a tempfs and schnapps doesn’t back those up. I can’t see anything explicitly guiding it it in /etc/config/schnapps.

Not a promise, a cursory inspection.