Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dry-Run Backup #1542

Open
KeithScheiwiller opened this issue Jan 10, 2018 · 8 comments

Comments

@KeithScheiwiller
Copy link

commented Jan 10, 2018

Related to #10

It would be nice to be able to see what all will be changed via a snapshot before actually creating one. In essence, a way to show a diff between the files stored in restic, and a given path on the local filesystem. This would especially help when making changes to backup configurations so as to be able to catch anything that might be missing/errantly included before hand.

I assume given the architecture, this would be impossible to do without going through the steps of an actual backup. If so, I think it makes more sense to position it as a dry-run backup (where nothing is actually committed) rather than a diff a la git status.

@fd0 fd0 added the feature request label Jan 13, 2018

@fd0

This comment has been minimized.

Copy link
Member

commented Jan 13, 2018

Hm, interesting idea, thanks. Maybe we can add this once #1494 is done, e.g. add some kind of backup --dry-run which only shows what would happen. This will also help developing and testing exclude filters.

@binnisb

This comment has been minimized.

Copy link

commented May 13, 2018

@fd0 Testing exclude filters is the reason I found this issue so 👍 from me.

@Liganic

This comment has been minimized.

Copy link

commented May 20, 2018

looking forward to this, now that #1494 is in, even if it's just super simple first iteration.

@hmage

This comment has been minimized.

Copy link

commented Jun 19, 2018

Chiming in to say that I want this to test exclude filters before I commit.

An output that shows per-file or per-folder size during dry run would be useful as well to find big culprits that don't need backing up.

@chrissv

This comment has been minimized.

Copy link

commented Oct 21, 2018

Another vote +1 for this useful feature!

@bjoe2k4

This comment has been minimized.

Copy link

commented Oct 21, 2018

Also +1 from me, would be extremely helpful!

@EmperorArthur

This comment has been minimized.

Copy link

commented Dec 4, 2018

Me too. It's not fun having to constantly delete snapshots or terminate a run early and have to clean things up while testing excludes.

@mholt

This comment has been minimized.

Copy link
Contributor

commented Dec 4, 2018

I've got my hands full at the moment, but would any of you like to submit a pull request?

rmmh added a commit to rmmh/restic that referenced this issue Jun 13, 2019

backup: add --dry-run/-n flag to show what would happen.
This can be used to check how large a backup is or validate exclusions.
It does not actually write any data to the underlying backend. This is
implemented as a simple overlay backend that accepts writes without
forwarding them, passes through reads, and generally does the minimal
necessary to pretend that progress is actually happening.

Fixes restic#1542

Example usage:

$ restic -vv --dry-run . | grep added
new       /changelog/unreleased/issue-1542, saved in 0.000s (350 B added)
modified  /cmd/restic/cmd_backup.go, saved in 0.000s (16.543 KiB added)
modified  /cmd/restic/cmd_prune.go, saved in 0.000s (6.724 KiB added)
modified  /cmd/restic/global.go, saved in 0.000s (0 B added)
new       /internal/backend/dry/dry_backend_test.go, saved in 0.000s (3.866 KiB added)
new       /internal/backend/dry/dry_backend.go, saved in 0.000s (3.744 KiB added)
modified  /internal/backend/test/tests.go, saved in 0.000s (0 B added)
modified  /internal/repository/repository.go, saved in 0.000s (20.707 KiB added)
modified  /internal/ui/backup.go, saved in 0.000s (9.110 KiB added)
modified  /internal/ui/jsonstatus/status.go, saved in 0.001s (11.055 KiB added)
modified  /restic, saved in 0.131s (25.542 MiB added)
Would be added to the repo: 25.898 MiB

rmmh added a commit to rmmh/restic that referenced this issue Jun 13, 2019

backup: add --dry-run/-n flag to show what would happen.
This can be used to check how large a backup is or validate exclusions.
It does not actually write any data to the underlying backend. This is
implemented as a simple overlay backend that accepts writes without
forwarding them, passes through reads, and generally does the minimal
necessary to pretend that progress is actually happening.

Fixes restic#1542

Example usage:

$ restic -vv --dry-run . | grep added
new       /changelog/unreleased/issue-1542, saved in 0.000s (350 B added)
modified  /cmd/restic/cmd_backup.go, saved in 0.000s (16.543 KiB added)
modified  /cmd/restic/cmd_prune.go, saved in 0.000s (6.724 KiB added)
modified  /cmd/restic/global.go, saved in 0.000s (0 B added)
new       /internal/backend/dry/dry_backend_test.go, saved in 0.000s (3.866 KiB added)
new       /internal/backend/dry/dry_backend.go, saved in 0.000s (3.744 KiB added)
modified  /internal/backend/test/tests.go, saved in 0.000s (0 B added)
modified  /internal/repository/repository.go, saved in 0.000s (20.707 KiB added)
modified  /internal/ui/backup.go, saved in 0.000s (9.110 KiB added)
modified  /internal/ui/jsonstatus/status.go, saved in 0.001s (11.055 KiB added)
modified  /restic, saved in 0.131s (25.542 MiB added)
Would be added to the repo: 25.898 MiB

rmmh added a commit to rmmh/restic that referenced this issue Jun 13, 2019

backup: add --dry-run/-n flag to show what would happen.
This can be used to check how large a backup is or validate exclusions.
It does not actually write any data to the underlying backend. This is
implemented as a simple overlay backend that accepts writes without
forwarding them, passes through reads, and generally does the minimal
necessary to pretend that progress is actually happening.

Fixes restic#1542

Example usage:

$ restic -vv --dry-run . | grep added
new       /changelog/unreleased/issue-1542, saved in 0.000s (350 B added)
modified  /cmd/restic/cmd_backup.go, saved in 0.000s (16.543 KiB added)
modified  /cmd/restic/cmd_prune.go, saved in 0.000s (6.724 KiB added)
modified  /cmd/restic/global.go, saved in 0.000s (0 B added)
new       /internal/backend/dry/dry_backend_test.go, saved in 0.000s (3.866 KiB added)
new       /internal/backend/dry/dry_backend.go, saved in 0.000s (3.744 KiB added)
modified  /internal/backend/test/tests.go, saved in 0.000s (0 B added)
modified  /internal/repository/repository.go, saved in 0.000s (20.707 KiB added)
modified  /internal/ui/backup.go, saved in 0.000s (9.110 KiB added)
modified  /internal/ui/jsonstatus/status.go, saved in 0.001s (11.055 KiB added)
modified  /restic, saved in 0.131s (25.542 MiB added)
Would be added to the repo: 25.898 MiB

rmmh added a commit to rmmh/restic that referenced this issue Jun 13, 2019

backup: add --dry-run/-n flag to show what would happen.
This can be used to check how large a backup is or validate exclusions.
It does not actually write any data to the underlying backend. This is
implemented as a simple overlay backend that accepts writes without
forwarding them, passes through reads, and generally does the minimal
necessary to pretend that progress is actually happening.

Fixes restic#1542

Example usage:

$ restic -vv --dry-run . | grep added
new       /changelog/unreleased/issue-1542, saved in 0.000s (350 B added)
modified  /cmd/restic/cmd_backup.go, saved in 0.000s (16.543 KiB added)
modified  /cmd/restic/global.go, saved in 0.000s (0 B added)
new       /internal/backend/dry/dry_backend_test.go, saved in 0.000s (3.866 KiB added)
new       /internal/backend/dry/dry_backend.go, saved in 0.000s (3.744 KiB added)
modified  /internal/backend/test/tests.go, saved in 0.000s (0 B added)
modified  /internal/repository/repository.go, saved in 0.000s (20.707 KiB added)
modified  /internal/ui/backup.go, saved in 0.000s (9.110 KiB added)
modified  /internal/ui/jsonstatus/status.go, saved in 0.001s (11.055 KiB added)
modified  /restic, saved in 0.131s (25.542 MiB added)
Would be added to the repo: 25.892 MiB

rmmh added a commit to rmmh/restic that referenced this issue Jun 13, 2019

backup: add --dry-run/-n flag to show what would happen.
This can be used to check how large a backup is or validate exclusions.
It does not actually write any data to the underlying backend. This is
implemented as a simple overlay backend that accepts writes without
forwarding them, passes through reads, and generally does the minimal
necessary to pretend that progress is actually happening.

Fixes restic#1542

Example usage:

$ restic -vv --dry-run . | grep added
new       /changelog/unreleased/issue-1542, saved in 0.000s (350 B added)
modified  /cmd/restic/cmd_backup.go, saved in 0.000s (16.543 KiB added)
modified  /cmd/restic/global.go, saved in 0.000s (0 B added)
new       /internal/backend/dry/dry_backend_test.go, saved in 0.000s (3.866 KiB added)
new       /internal/backend/dry/dry_backend.go, saved in 0.000s (3.744 KiB added)
modified  /internal/backend/test/tests.go, saved in 0.000s (0 B added)
modified  /internal/repository/repository.go, saved in 0.000s (20.707 KiB added)
modified  /internal/ui/backup.go, saved in 0.000s (9.110 KiB added)
modified  /internal/ui/jsonstatus/status.go, saved in 0.001s (11.055 KiB added)
modified  /restic, saved in 0.131s (25.542 MiB added)
Would be added to the repo: 25.892 MiB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.