2017-06-06 22:06:36 +00:00
|
|
|
.. include:: export-tar.rst.inc
|
|
|
|
|
2022-04-02 18:11:05 +00:00
|
|
|
.. include:: import-tar.rst.inc
|
|
|
|
|
2017-06-06 22:06:36 +00:00
|
|
|
Examples
|
|
|
|
~~~~~~~~
|
|
|
|
::
|
|
|
|
|
|
|
|
# export as uncompressed tar
|
2022-06-23 23:19:19 +00:00
|
|
|
$ borg export-tar Monday Monday.tar
|
2017-06-06 22:06:36 +00:00
|
|
|
|
2022-04-02 18:11:05 +00:00
|
|
|
# import an uncompressed tar
|
2022-06-23 23:19:19 +00:00
|
|
|
$ borg import-tar Monday Monday.tar
|
2022-04-02 18:11:05 +00:00
|
|
|
|
|
|
|
# exclude some file types, compress using gzip
|
2022-06-23 23:19:19 +00:00
|
|
|
$ borg export-tar Monday Monday.tar.gz --exclude '*.so'
|
2017-06-06 22:06:36 +00:00
|
|
|
|
|
|
|
# use higher compression level with gzip
|
2022-06-23 23:19:19 +00:00
|
|
|
$ borg export-tar --tar-filter="gzip -9" Monday Monday.tar.gz
|
2017-06-06 22:06:36 +00:00
|
|
|
|
2022-04-02 18:11:05 +00:00
|
|
|
# copy an archive from repoA to repoB
|
2022-06-23 23:19:19 +00:00
|
|
|
$ borg -r repoA export-tar --tar-format=BORG archive - | borg -r repoB import-tar archive -
|
2022-04-02 18:11:05 +00:00
|
|
|
|
|
|
|
# export a tar, but instead of storing it on disk, upload it to remote site using curl
|
2022-06-23 23:19:19 +00:00
|
|
|
$ borg export-tar Monday - | curl --data-binary @- https://somewhere/to/POST
|
2017-07-26 08:40:35 +00:00
|
|
|
|
|
|
|
# remote extraction via "tarpipe"
|
2022-06-23 23:19:19 +00:00
|
|
|
$ borg export-tar Monday - | ssh somewhere "cd extracted; tar x"
|
2022-04-02 18:11:05 +00:00
|
|
|
|
|
|
|
Archives transfer script
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Outputs a script that copies all archives from repo1 to repo2:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
2024-09-18 12:05:12 +00:00
|
|
|
for N I T in `borg list --format='{archive} {id} {time:%Y-%m-%dT%H:%M:%S}{NL}'`
|
2022-04-02 18:11:05 +00:00
|
|
|
do
|
2024-09-18 12:05:12 +00:00
|
|
|
echo "borg -r repo1 export-tar --tar-format=BORG aid:$I - | borg -r repo2 import-tar --timestamp=$T $N -"
|
2022-04-02 18:11:05 +00:00
|
|
|
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
|