I already use restic on 4 Linux Servers to SFTP on other machine & 1 Windows machine (with STFP backup via https://relicabackup.com/).
All works great. This is a great backupsolution.
I have a very simple and basic question (sorry):
However in all cases I just backup one folder including subfolders per repository.
Now I would like to add other folders.
So, I currently use: restic -r sftp:backupserveruser@backupserver.com:/_backupspace_repository_server1/ backup --verbose /var/mail
How should I backup another folder?
Example if I copy both /var/mal and /home/users/username to a folder /backup I will have a messup of both folders.
Will the backupserver understand, that these are from different orgins when I just use it like this? Or do I have to do this differently to avoid creating a mess?
This is actually really simple. If you run restic help backup itâll tell you that the syntax for the backup command is restic backup [flags] FILE/DIR [FILE/DIR] .... The FILE/DIR [FILE/DIR] ... part there means âat least one FILE/DIR, optionally followed by another FILE/DIR, and optionally more of thisâ. So just add the other files/folders/paths you want to back up to the same command (donât forget to quote those that have spaces in them, as you separate the paths you name in the command with spaces).
Not sure what you mean by origin. But in short, just list whichever paths you want to back up in one and the same restic command, on each host. You can then run the snapshots command to list the snapshots you have in your repository - you will see which paths each snapshot has backed up.
Not really - it depends on your use case. Some people prefer to back up their entire system by backing up / with the --one-file-system and using e.g. --exclude or similar to exclude things like /proc, /dev and so on. Personally I would not do that, instead I would only back up the data I want, e.g. ~ and maybe some /var/mail or whatever. If I have the situation that the entire system is lost, I will just reinstall it (doesnât take much time) and restore my data.
restic basically uses 3 ways to distinguish backups from each other: hostname, tags and path. You can use these 3 when working with commands like snapshots, find, ls or forget to narrow the output down.
Something that has been working very well for me is using 3 âsetsâ of backup for every server: configuration, data and logs.
This makes it easy to apply different prune policies independent of the path (i.e. restic forget --group-by host,tags --tag data --keep-daily 30 and restic forget --group-by host,tags --tag logs --keep-weekly 12).
In short: you might think about using tags as this makes dealing with different (changing) paths a lot easier.
I think what youâre getting at here is âif I specify multiple backup source directories, will they get combined into one directory in the backup?â The answer is no, restic will keep these directories separate in the snapshot. You can confirm this by running a backup with two source directories and then running restic ls on the newly-created snapshot. You will see that the source directories are not merged.
As a side note, restic doesnât have a backup server; all of the backup logic is in the client. The repository can be dumb storage (just a directory, or S3, etc.).