rustic icon indicating copy to clipboard operation
rustic copied to clipboard

`multibackup`: runs multiple backup runs in a row generating a couple of snapshots

Open aawsome opened this issue 2 years ago • 4 comments

Add a command which runs multiple backup runs in a row generating a couple of snapshots. Maybe add a --merge option once rustic-rs/rustic#411 is finished to directly merge them into one snapshot.

aawsome avatar Mar 07 '23 05:03 aawsome

I'm just going to reference/duplicate this comment that I made previously in 458, but I think it might have been overlooked since the PR was already merged.

It would be great to use stdin along with a path to do a multiple source backup.

I'd like to be able to run a cron job that does mysqldump and then passes that to rustic via stdin (as you showed us), but also back up a directory at the same time

Here's the code I have. It works for backing up the mysqldump

docker compose exec --user devilbox php mysqldump -h mysql -u root --skip-comments dbname
| rustic -r rclone:onedrive:wsl2 backup --stdin-filename dbname.dump -

I'd like to change it to something like this

docker compose exec --user devilbox php mysqldump -h mysql -u root --skip-comments dbname
| rustic -r rclone:onedrive:wsl2 backup /home/nick/backup_directory --stdin-filename dbname.dump - But it says Error: No such file or directory (os error 2) even though /home/nick/backup_directory is a valid path

If it isn't possible, I suppose I could just change the crontab script to instead generate a mysqldump file instead of use stdin, then run the multi-path backup, then delete the dump.

It would appear from your comment here that this will be possible with this PR.

Yes, definitely. This, and multiple types of sources (local FS, stdin, maybe others to come in future).

nickchomey avatar Mar 07 '23 14:03 nickchomey

Yes, the multibackup I'm referring here would make such a thing possible - maybe using a slightly different syntax. But by default it will create multiple snapshots. Only if rustic-rs/rustic#411 is finished, this can be included to automatically merge the generated snapshots into one and not saving the single ones.

aawsome avatar Mar 07 '23 15:03 aawsome

I'm not sure that I understand it correctly but it would be cool to have command that do a few backups one after another with completely different options (different tags, excludes, etc). Final result should looks exactly same as multiple independent rustic calls. The goal is to just save CPU time for loading indexes multiple times.

dionorgua avatar Apr 07 '23 16:04 dionorgua

@dionorgua Yes, this is exactly what the multibackup command would be meant for. Plus maybe an --merge option which does exactly the same as calling rustic merge --delete with all snapshots that has just been generated.

aawsome avatar Apr 07 '23 16:04 aawsome