Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26th June 2010, 04:36 AM
Bluefish001 Offline
Registered User
 
Join Date: Jan 2009
Posts: 6
macosfirefox
Attempting to backup to a remote file system

Attempting to create a backup script to copy files from one file system to a remote file system.

When I try this I get:
Quote:
# tar -cf - /mnt/raid_md1 | gzip -c | ssh -i ~/.ssh/key -l user@192.168.1.1 "cat > /mnt/backup/fileserver.md1.tar.gz"
tar: Removing leading `/' from member names
Pseudo-terminal will not be allocated because stdin is not a terminal.
ssh: Could not resolve hostname cat > /mnt/backup/fileserver.md1.tar.gz: Name or service not known
When I add -t -t I get this:
Quote:
# tar -cf - /mnt/raid_md1 | gzip -c | ssh -t -t -i ~/.ssh/key -l user@192.168.1.1 "cat > /mnt/backup/fileserver.md1.tar.gz"
tar: Removing leading `/' from member names
ssh: Could not resolve hostname cat > /mnt/backup/fileserver.md1.tar.gz: Name or service not known
Not sure what I am missing... I know that the remote file system dir is RW and the access is working fine. I am stumped.... hoping someone can point me in the right direction.
Reply With Quote
  #2  
Old 26th June 2010, 05:36 AM
forkbomb's Avatar
forkbomb Offline
Registered User
 
Join Date: May 2007
Location: U.S.
Posts: 4,852
linuxfirefox
Re: Attempting to backup to a remote file system

This is what you're after? Try to lose the -l switch (I think that's extraneous if you're doing user@hostname or user@ipaddr). I'd also drop the pipe over to gzip and do it with a switch straight to tar, though that shouldn't make a difference.
Code:
tar zcvf - /mnt/raid_md1 | ssh user@192.168.1.1 -i ~/.ssh/key "cat > /mnt/backup/fileserver.md1.tar.gz"
One other option you could look into is to mount the remote system as an sshfs using fuse (at which time the local machine will treat the remote share as if it were a local file system). This is dated but a good start: http://www.linuxjournal.com/article/8904
__________________
- Tom
"What is freedom? To have the will to be responsible for one's self." - Stirner

Last edited by forkbomb; 26th June 2010 at 05:39 AM.
Reply With Quote
  #3  
Old 26th June 2010, 04:25 PM
Bluefish001 Offline
Registered User
 
Join Date: Jan 2009
Posts: 6
macosfirefox
Re: Attempting to backup to a remote file system

That did the job thank you:
Can you detail the syntax so I have a clearer understanding of what is going on.... really confused about the use of cat in ""
Reply With Quote
  #4  
Old 1st July 2010, 11:58 PM
SiliconSlick's Avatar
SiliconSlick Offline
Registered User
 
Join Date: Aug 2009
Location: College Station, TX
Posts: 501
linuxfedorafirefox
Re: Attempting to backup to a remote file system

The use of '-' (hyphen), tells tar to write the tar output file (f option to tar) to standard output. That is piped (|) to cat (via SSH) which reads that standard output as its standard input and dumps the result to /mnt/backup/... via redirection (>) of its standard output.

SS
Reply With Quote
Reply

Tags
backup, remote, ssh

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do realtime backup when file change should be automatic backup jazzaamiga Using Fedora 3 12th February 2007 10:48 AM
help: how to mount a remote unix file system to local fc2 using nfs? parv Using Fedora 0 23rd September 2004 06:36 PM


Current GMT-time: 10:01 (Saturday, 18-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat