Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tar to another server

Status
Not open for further replies.

apocalypse11

Technical User
Jan 11, 2001
77
AU
I need to tar a dir on one server and store it on another server (because the tar would be to big for the local server). How can I do this in one command?

Thanks
 
Hows about exporting the directory you want to tar up and then mounting it on the system with the disk space. Then tar up the mounted directory and specify the tar file to be placed on the local machine.

hth
 
Sounds great.... how do I do this?

Sorry to ask to simple questions.

 
The quickest way is to edit the /etc/exports (assuming you have root access) file on the source system (the one with not enough disk space). Then on the target system, ensuring that both hosts know about each other i.e. each host has the others IP and hostname in the /etc/hosts file issue the command, again as root:

mount <directoryname>@hostwithnospace mountpoint.

e.g. mount /usr/users/me@myhost1 /mnt

Then all you need to do on the system with diskspace issue the command:

tar cvf /var/tmp/myhost1savedfiles.tar /mnt/*

You'll need to use a location (e.g. /var/tmp above) that has enough disk space though.


I love deadlines. I like the whooshing sound they make as they fly by.

Douglas Adams
 
Hi all,

Thanks for your help. A friend of mine got the first question answered:

tar cf - <files> | ssh <server> cat \>filename
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top