I'm looking for the fastest way of copying a file between 2 linux servers using bsdtar.
With normal tar, I would do something like:
ssh root@remote 'tar -cz -C /my/path/ big_file.txt' | tar -zxv
However, just replacing "tar" with "bsdtar" does not seem to work.
So, my questions are:
- How would I do this with bsdtar?
- Instead of using gzip, I would like to use something that can use multiple cores for the compress/uncompress, like pbzip2. How would I pipe this in?
- I want the file "big_file.txt" to be called "hello_world.txt" on the destination server without using a temp-file with renaming. How?
I solved number 1 myself:
ssh root@localhost 'bsdtar -cz -f - -C /my/path/ big_file.txt' | tar -zxv
I solved number 3 myself:
ssh root@localhost 'bsdtar -cz -f - -C /my/path/ big_file.txt' | tar -zxv -O > test.txt