LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 09-17-2013, 07:56 AM   #1
venki
Member
 
Registered: Sep 2006
Location: India
Distribution: suse10.2
Posts: 128

Rep: Reputation: 15
tar the file and move to another server


Hi All

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 )"
 
Old 09-17-2013, 08:13 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.)
 
Old 09-17-2013, 08:34 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
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)
 
Old 09-17-2013, 09:33 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
So what were the errors if any?

Quote:
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?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
tar the last periodic backup that is in another path and move the tar to some dir nelovicov Linux - Newbie 6 01-20-2012 09:40 AM
move file from server to server using ssh (putty), plz help niitpro Linux - Newbie 2 02-07-2008 09:43 PM
gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file gautham Linux - General 4 04-13-2005 03:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration