LinuxQuestions.org
Visit Jeremy's Blog.
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 06-13-2005, 10:55 AM   #1
nifflerX
Member
 
Registered: Dec 2003
Distribution: RedHat 8.0, 7.1 and Enterprise WS 3,4
Posts: 94

Rep: Reputation: 16
tar and ftp put on the fly


Hi,

I'm looking for a way to backup my data using an online storage facility. The facility only allows access through a kerborsed ftp client and my data is pretty big and has a ton of folders. Due to this I'd very much like to tar my directories so I can keep the directory structure if I ever have to get the data off this online storage facility. My problem is I don't have enough room to make a duplicate copy of my data in a tar file and send it, via ftp, to the storage facility. Is there a way I can tar and put data 'on the fly'? Basically I'm looking for a way where I don't need the space to hold an entire .tar file of all my data before putting it with ftp. Thanks very much.


-NifflerX


p.s. The distro I'm using is redhat linux if that makes a difference.
 
Old 06-13-2005, 05:44 PM   #2
dub.wav
Member
 
Registered: Aug 2003
Location: Norway
Distribution: FC4
Posts: 83

Rep: Reputation: 20
You have to use a named pipe.

Create the fifo and start tar:
mkfifo backup.tar.gz
tar cvzf backup.tar.gz / &

ftp to the host, and log in:
ftp hostname
Tell ftp to cat the pipe (just 'put backup.tar.gz' won't work)
put |"cat backup.tar.gz" backup.tar.gz
 
Old 06-13-2005, 07:51 PM   #3
mhallbiai
Member
 
Registered: Jun 2005
Posts: 96

Rep: Reputation: 15
just a note to dub.wav's instructions, you might want to make sure that you are transferring in binary mode before you start the upload depending on the types of files you are uploading
 
Old 06-14-2005, 09:01 AM   #4
nifflerX
Member
 
Registered: Dec 2003
Distribution: RedHat 8.0, 7.1 and Enterprise WS 3,4
Posts: 94

Original Poster
Rep: Reputation: 16
Thanks so much, I'll give this a try.

-NifflerX

EDIT: Worked like a charm. Thanks so much for the help!

Last edited by nifflerX; 06-14-2005 at 09:47 AM.
 
Old 06-14-2005, 09:49 AM   #5
nifflerX
Member
 
Registered: Dec 2003
Distribution: RedHat 8.0, 7.1 and Enterprise WS 3,4
Posts: 94

Original Poster
Rep: Reputation: 16
Just a quick question. What do I do with the fifo file once I've got the tar file uploaded? Can I just delete it? Or is there a proper way to close it? Thanks again.


-NifflerX
 
Old 06-14-2005, 11:37 AM   #6
dub.wav
Member
 
Registered: Aug 2003
Location: Norway
Distribution: FC4
Posts: 83

Rep: Reputation: 20
You can just delete it. Any way I got the solution off google, and it was late so my mind wasn't working properly.
You don't need the named pipe, if you want to you can embed the tar command in the put command, like this:
Code:
put |"tar cvzf - /" backup.tar.gz
(I haven't tested it, but it should work.)
 
Old 06-14-2005, 11:45 AM   #7
nifflerX
Member
 
Registered: Dec 2003
Distribution: RedHat 8.0, 7.1 and Enterprise WS 3,4
Posts: 94

Original Poster
Rep: Reputation: 16
Thanks for info. I'll try this way as well, although the other way already works, so if something hitches I'll still be okay. Thanks again for all the help.

-NifflerX

EDIT: Just for general knowledge, both ways worked.

Last edited by nifflerX; 06-14-2005 at 11:51 AM.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 10:55 AM
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 10 02-23-2008 05:40 AM
tar get on the fly nifflerX Linux - General 3 07-27-2005 10:09 AM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 06:30 AM
Installing my ftp tar file...need help please vbp6us Linux - General 2 03-11-2003 02:27 PM


All times are GMT -5. The time now is 06:23 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration