Conversation
Contributor
|
depends on #54 |
The backup script gzips the volumes exported from podman and outputs them to stdout. The restore script takes an archive of this same format from stdin and imports the volumes into podman after deleting them and re-creating them afresh. Sample usage: $ ./backup.sh > archive.tar.gz $ ./restore.sh < archive.tar.gz # containers must be down Fixes #62 Signed-off-by: Joel Savitz <jsavitz@redhat.com>
Keep them together in a dedicated place instead of cluttering the root of the project.
Once source of truth is better for when we inevitability need to update this list of volumes
like the other scripts we should show what we are doing and exit if something goes wrong. The trace goes to stderr so it doesn't interfere with redirecting the output into the tar file
After running these a few times /tmp was literred with many folders since neither script deletes their tmpdir after they are finished.
As suggested by shellcheck, it doesn't hurt to quote the variable references even though they shouldn't be able to contain spaces
pushd and popd are not specified by posix for the shell, so if we use /bin/sh we should avoid them. In this case we aren't using more than one level of stack anyways so there is really no need to use them at all.
Now that both pass shellcheck, we should keep them that way by linting them in the tests.
Contributor
Author
it's true, the scripts don't work when invoked outside of their directories |
Signed-off-by: Joel Savitz <jsavitz@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The backup script gzips the volumes exported from podman and outputs them to stdout. The restore script takes an archive of this same format from stdin and imports the volumes into podman after deleting them and re-creating them afresh.
Sample usage:
$ ./backup.sh > archive.tar.gz
$ ./restore.sh < archive.tar.gz # containers must be down
Fixes #62