Reputation: 1793
Actually I want to tar a directory from different-different server and need to move that tar to my current server on which I am working so I am writing a shell script for that and had used the following command for this
ssh hostname " tar -cvj site1.tar.gz -C /www/logs/test " > site2.tar.gz
I had also tried moving it to a directory on my current server but not able to achieve that also, command tried -
ssh hostname " tar -cvj site1.tar.gz -C /www/logs/test " > /www/logs/automate
I tried this and think that it will not work, so is their any other way to achieve this, Please help. It will be appreciable. Thanks.
Upvotes: 0
Views: 73
Reputation: 88636
With GNU tar:
ssh hostname "tar -C /www/logs/test -cjf -" > your.tar.bz2
-f -
: write archive to stdout
Upvotes: 2