tar.rst 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. .. include:: export-tar.rst.inc
  2. .. include:: import-tar.rst.inc
  3. Examples
  4. ~~~~~~~~
  5. ::
  6. # export as uncompressed tar
  7. $ borg export-tar Monday Monday.tar
  8. # import an uncompressed tar
  9. $ borg import-tar Monday Monday.tar
  10. # exclude some file types, compress using gzip
  11. $ borg export-tar Monday Monday.tar.gz --exclude '*.so'
  12. # use higher compression level with gzip
  13. $ borg export-tar --tar-filter="gzip -9" Monday Monday.tar.gz
  14. # copy an archive from repoA to repoB
  15. $ borg -r repoA export-tar --tar-format=BORG archive - | borg -r repoB import-tar archive -
  16. # export a tar, but instead of storing it on disk, upload it to remote site using curl
  17. $ borg export-tar Monday - | curl --data-binary @- https://somewhere/to/POST
  18. # remote extraction via "tarpipe"
  19. $ borg export-tar Monday - | ssh somewhere "cd extracted; tar x"
  20. Archives transfer script
  21. ~~~~~~~~~~~~~~~~~~~~~~~~
  22. Outputs a script that copies all archives from repo1 to repo2:
  23. ::
  24. for N I T in `borg list --format='{archive} {id} {time:%Y-%m-%dT%H:%M:%S}{NL}'`
  25. do
  26. echo "borg -r repo1 export-tar --tar-format=BORG aid:$I - | borg -r repo2 import-tar --timestamp=$T $N -"
  27. done
  28. Kept:
  29. - archive name, archive timestamp
  30. - archive contents (all items with metadata and data)
  31. Lost:
  32. - some archive metadata (like the original commandline, execution time, etc.)
  33. Please note:
  34. - all data goes over that pipe, again and again for every archive
  35. - the pipe is dumb, there is no data or transfer time reduction there due to deduplication
  36. - maybe add compression
  37. - pipe over ssh for remote transfer
  38. - no special sparse file support