Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
In server 13 , I have a folder called nagesh.
It is around 145GB and free space on the server is 150GB
so, I am unable to tar it.
I need to tar and scp to another server called 14.
So, is there any way directly I can tar the folder in server 14 ?
I have tried like this
tar -cpf - nagesh | /usr/bin/ssh radh@13 "( cd /home/nagesh/work/scripts ; cat > nagesh.tar )"
If you have a 150 GB free you should be able to tar 145 GB.
However since you're trying to preserve space and copy to another server anyway you should just make your original tar file with the "-z" option which filters the archive through gzip (to make a .tgz or .tar.gz file). You could then copy this file across with scp. By doing it this way you'd preserve bandwidth on the transfer.
If your ultimate goal is to untar the file on the other side anyway you might want to use rsync instead. It can be used to duplicate directory structures from one location to another and has options for compressing/decompressing as it transfers so again reduces bandwidth. (Also it has the beauty that it only transfers what is different so if it got interrupted and restarted it would only have to transfer what hadn't yet been completed.)
the tar command you executed is ok. To be able to run tar on server14 you need to make the dir nagesh available on server14. (you need to share and mount that dir somehow)
tar -cpf - nagesh | /usr/bin/ssh radh@14 "cat > /home/nagesh/work/scripts/nagesh.tar"
I assumed that "radh@13" in your first post was a typo however does user radh exist on server 14? If so do does user radh have permissions to write to /home/nagesh/work/scripts?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.