LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-21-2012, 06:42 AM   #1
Vi_rod
Member
 
Registered: Dec 2011
Posts: 42

Rep: Reputation: Disabled
Create Tar of a directory present in another server


Hi,
How to create a tar of a directory present in another server ?

I m presently using this in my script and it gives me an error " cannot find this directory"

tar zcvf - /ab-xy | ssh root@192.168.2.102:/opt/sg/web/tomcat/webapps "cat > /opt/sg/backup/applic.tar.gz"

All i want to achieve is tar a folder present in server 102 and copy it to backup directory of my current server
 
Old 03-21-2012, 10:21 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
I'd do the opposite (first the tar command on the remote machine sending the gzipped archive to the standard output, then redirection to a local tar.gz):
Code:
ssh root@192.168.2.102 "tar zcvf - /opt/sg/web/tomcat/webapps/ab-xy" > /opt/sg/backup/applic.tar.gz
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using TAR to create backup of files created today in data directory Vi_rod Linux - Newbie 3 12-23-2011 01:00 PM
How can i create .tar.gz,.tar.bz2,.zip file and upload with filezilla=> uncompress? cola Linux - General 1 09-14-2011 02:32 PM
Unable to create a new user in Directory Server naman.jandial Linux - Server 4 07-16-2010 06:30 PM
how to create a new data directory for mysql server 5.1.31 vinaytp Linux - Newbie 6 04-23-2009 04:15 AM
Unable to create a tar file from spanning a directory tree? R00ts Linux - General 2 11-01-2006 11:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:36 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration