Backup directory with different settings for subdirs (etc. daily/hour backup)

at the moment i have setup to different repositories. the one will backup /path/to/htdocs, there are a few dirs excludes. this backup will run once a day.
then i have aonther repository. this willl backup /path/to/htdocs/data (data was one of the excludes dirs in the first repo). this will be backuped every two hours.

for the first repo i will call
/opt/restic forget --keep-daily 21 --keep-weekly 5 --keep-monthly 6 --prune --verbose

for the second
/opt/restic forget --keep-daily 6 --prune --verbose

can i have both backuped to the same repo?

i tried to copy repo2 into repo1 (i have cloned/copied repo1 as repo1.test). but when i do a mount of the repo i see every snapshots from both backups. so i can access /path/to/htdocs/… and in the other snapsho /path/to/htdocs/data. but i don’t see both diretiries in one point so i can browse the complete tree…

is this possible with one repository or ist it really wise to have two single reporistories.

what i want to have is one “mount-point” where i can see contents of both backups eg

/path/to/htdocs/dir1
/path/to/htdocs/data
/path/to/htdocs/images

at the moment i dir1 and images but not together with data. i can access it via different snapshots…

markus

Is your question about the backup, forget or mount command?

About your mount question: To see paths in one tree, they must be in the same snapshot. With backup you can either backup multiple paths or use excludes to filter out paths-not-to-backup (seems you are actually using this).
With forget, you can use your retention policy on groups using the --group-by option or only to a group which can be selected by the --host, --pathand --tag options.

My recommendation (without actually knowing your demand):
Why not backup /path/to/htdocs with different exclude rules to include/exclude /path/to/htdocs/data according to your schedule and add tags to differentiate between the different exclude options.
Then you can use forget --tag xxx to forget snapshots with the tag xxx according to the specified retention policy and do the same for all other tags.

1 Like