-
-
Notifications
You must be signed in to change notification settings - Fork 750
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6523 from ThomasWaldmann/pax-borg-item-master
import/export-tar: --tar-format=BORG: roundtrip ALL item metadata
- Loading branch information
Showing
4 changed files
with
115 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,57 @@ | ||
.. include:: import-tar.rst.inc | ||
|
||
.. include:: export-tar.rst.inc | ||
|
||
.. include:: import-tar.rst.inc | ||
|
||
Examples | ||
~~~~~~~~ | ||
:: | ||
|
||
# export as uncompressed tar | ||
$ borg export-tar /path/to/repo::Monday Monday.tar | ||
|
||
# exclude some types, compress using gzip | ||
# import an uncompressed tar | ||
$ borg import-tar /path/to/repo::Monday Monday.tar | ||
|
||
# exclude some file types, compress using gzip | ||
$ borg export-tar /path/to/repo::Monday Monday.tar.gz --exclude '*.so' | ||
|
||
# use higher compression level with gzip | ||
$ borg export-tar --tar-filter="gzip -9" testrepo::linux Monday.tar.gz | ||
$ borg export-tar --tar-filter="gzip -9" repo::Monday Monday.tar.gz | ||
|
||
# export a tar, but instead of storing it on disk, | ||
# upload it to a remote site using curl. | ||
# copy an archive from repoA to repoB | ||
$ borg export-tar --tar-format=BORG repoA::archive - | borg import-tar repoB::archive - | ||
|
||
# export a tar, but instead of storing it on disk, upload it to remote site using curl | ||
$ borg export-tar /path/to/repo::Monday - | curl --data-binary @- https://somewhere/to/POST | ||
|
||
# remote extraction via "tarpipe" | ||
$ borg export-tar /path/to/repo::Monday - | ssh somewhere "cd extracted; tar x" | ||
|
||
Archives transfer script | ||
~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Outputs a script that copies all archives from repo1 to repo2: | ||
|
||
:: | ||
|
||
for A T in `borg list --format='{archive} {time:%Y-%m-%dT%H:%M:%S}{LF}' repo1` | ||
do | ||
echo "borg export-tar --tar-format=BORG repo1::$A - | borg import-tar --timestamp=$T repo2::$A -" | ||
done | ||
|
||
Kept: | ||
|
||
- archive name, archive timestamp | ||
- archive contents (all items with metadata and data) | ||
|
||
Lost: | ||
|
||
- some archive metadata (like the original commandline, execution time, etc.) | ||
|
||
Please note: | ||
|
||
- all data goes over that pipe, again and again for every archive | ||
- the pipe is dumb, there is no data or transfer time reduction there due to deduplication | ||
- maybe add compression | ||
- pipe over ssh for remote transfer | ||
- no special sparse file support |
This file contains 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
This file contains 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
This file contains 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