Hi All,
I am trying to create a tar from absolute path then transfer that file to another machine.
But tar is not taking the absolute (full) path.
Could you please help. I tried tar -cvf
option at source and tar -xvf
option at destination
My variable has 3 files with full path
LIST="/var/tmp/ROLLabc.20191203 /var/tmp/ROLLdef.20191203 /var/tmp/ROLLghi.20191203"
I am using simple loop to tar the file
for filename in $LIST
do
echo "Transferring $filename to xyz machine...!"
tar -cvf - $filename |ssh -p222 username@<Some JUMPBOX> "ssh user@<xyz machine> \"cd /var/tmp; tar -xvf -\""
done
Error i get is:
Transferring /var/tmp/ROLLabc.20191203 to xyz...!
a /var/tmp/ROLLabc.20191203 535K
tar: Removing leading '/' from '/var/tmp/ROLLabc.20191203'
x var/tmp/ROLLabc.20191203, 95298 bytes, 5069 tape blocks