Hi all. Backups are vital, both on servers and on a personal computer.
The fact is that in order to conveniently and efficiently make backups, we need certain tools for this. Personally, I’m only familiar with timeshift, but it doesn’t quite meet my needs:
It is needed for backups of system files, not personal ones. It can be used for personal files, but I’m not sure if it’s correct.
It does not archive files, which is why snapshots weigh quite a lot. Why not use 7-zip’s aggressive compression so that it uses less space?
It cannot store files on a remote server. If we use a server, it would be good to use a separate FTP storage for backups.
Summarizing all the above, I have the following questions:
Should I try to keep system and personal files separate? I believe that personal configurations, such as KDE settings, should also be included in the system files. The problem is that it is stored in the user’s local folder and is not considered part of the system.
Is it possible to compress snapshots so that they take up less space?
Is it possible to send snapshots to a remote FTP server?
I have a small script, as I imagine it, but I’m not at all sure that this is correct:
# FTP storage settings
# create snapshot
sudo timeshift --create &&
# zip all snapshots
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on snapshots.7z /timeshift/ &&
# send (overwrite) snapshots archive to FTP server
# it will also delete source file (our archive) on success
lftp ftp://$FTP_USER:$FTP_PASSWORD@FTP_SERVER -e \
"set ftp:ssl-allow no; put -e -E snapshots.7z; quit" &&
My idea is that to restore we just download the archive, unzip it to /timeshift/ and we can restore the snapshots as usual.
I personally use Restic, which is Borg’s alternative.
Both are similar, but Restic doesn’t support compression yet. Borg does not support multithreads
But Borg is written in Python, Restic is written in GO. That is why Restic’s benchmark is faster.
Both have no GUI.
If you need GUI, maybe Kopia would be interesting for you
Should I use Borg\Restic for system files backup? I find some information but it doesn’t look like timeshift at all. Using timeshift, I can simply restore a snapshot of the system with one command, but here it’s just an archive with data. If, for example, I took a snapshot before installing a dangerous program and this program broke everything for me, how can I “roll back” to the previous system snapshot?
i would never backup to the drive i’m using, it must be always a external device. i like the option to backup a real clone. once my disk will die i’ll replace the drive just with the clone and i’m back on track. less than 5 minutes of work and even the worst case (broken disk) is solved. using nvme’s gives acceptable speed and while backing up i’ll get a coffee and a smoke. what can be better ?
i had broken disks a couple of times in my life and that’s the moment when you have to have a real solution. clonezilla is the key
The difference between timeshift and borg is just that:
timeshift is made for hot backups
borg is made for cold backups
So think of timeshift like on Windows “System Recovery”.
I would suggest using timeshift for the root directory and borg for important files. Any configurations can go to a git repo.
If it is btrfs, you can increase the compression level.
You can use btrfs send to grab a raw stream of the snapshot and pipe it to a file. Also btrfs receive can get the file and put it back on the partition.
A raw stream cannot be mounted and is not searchable.
I have Synology NAS for this. One of the features of a NAS are exactly backups. My backups are set up as following:
system files specifically / partition (no home, no mounts): timeshift
/home partition: instant backup with Synology Drive Client
other partitions: not backed up
I recommend a similar setup, timeshift is great for undoing updates that went bad. That lowers my enxiety when updating because some things on the system absolutely need to work 100% of the time.
A NAS solution may be expencive, but it will always cost less than you personal files. I learned that once. Synology seems to work very well with its home cloud solution, but you can also build you own server and with some open source cloud solution like owncloud. A cloud solution is also better than others because files get synced instantly as soon as you save them and they can be easily configuret to be one way or both ways and also a good cloud solution will also handle versioning of your files.
I also have other partitions/folders that I don’t backup. Those contain unimportant files, like games and temporary downloads.
When it comes to saving backups, it a rather a deep rabit hole… some crazy gurus say, for a real backup, you need one local copy then one copy on another location and finally another copy on another continent For me a backup on a NAS with full redundancy is enough for me.
Unless you also wan’t to hack with rsync and whatnot along the way, I recommend timeshift + cloud solution.
My favorite method for backin up the system is CloneZilla. It can store the output file wherever you want, even on a remote computer. And it has different compression methods with my favorite compression being z9p which is designed for multicore systems and compresses 36 GB to a 16 GB file in less than 3 minutes. Decompression is even faster.