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!

ftp directory

Status
Not open for further replies.

Nostradamus

Technical User
May 3, 2000
419
SE
I use Sco Openserver 5.0.5.

I've constructed a simple ftp-script to automatically transfer files for backup purposes.
I'ts okay as long as a want to tranfser multiple files (using mput *), but I want to transfer directories and their sub-directories. How do I do that using the standard ftp program?

I thought about tar-ing it to one file and transfer, but It's 11 Gb of data and the disk can't contain both files and tar file (16Gb HD).

Ideas anyone?

/Sören
 
I've never been able to figure out how to put a directory.

Since you don't have enough room, have you thought about doing this in bits and pieces? How about writing a script that tars up some of the directories, compresses the tar file, ftp's to the destination, then delete the compressed tar file and go on to the next set of directories?

Or your script will have to become more detailed: changing the local directory, changing the remote directory, then ftp'ing.

On advantage to ftp'ing a tar file is that the files you are trying to back up will retain their ownership, permissions and time stamps, because they are within the tar file. When you ftp a file, all of these things can change. Depending on what you are backing up, this could be very important.

 
I don't know SCO, but look for something like [tt]mount[/tt] and [tt]share[/tt]. If you can mount a partition from one machine on the other, you can use tar to put the tar file directly on the destination machine. It would be something like...
[tt]
cd fromdir; tar cf - . | (cd todir; tar xfBp -)
[/tt]
...where [tt]todir[/tt] is the remotely mounted partition.

If you wanted to just put it in a tar file on another machine, you could also look into doing something like...
[tt]
cd fromdir
tar cvf - . | rsh host dd of=/todir/backup.tar
[/tt]
You might have to play with the parameters, but something like that should work.

Hope this helps.

 
thanks for you input.
I'd prefer to have one tar-file and one ftp session, but to split it up newer occoured to me.

SamBones idea is perhaps even greater (at least for my purposes).

I'm not ftp-ing to another unix machine which is a shame, but to our backup server. Windows 2k that is.
The mounting part made me think of something.
If I install a nfs-server on the remote machine, I could easily transfer all files
without taring it together.

Anyone know of a good freeware solution?

/Sören
 
You could always use Samba and mount a Windows share on the SCO machine.

//Daniel
 
I second the SAMBA suggestion! In any situation where you have a mix of Windows and Unix, SAMBA is the solution to so many things.

With SAMBA you could even mount your unix drives as shares on a Windows system and use a Windows based backup program.

Another possible solution, if you're willing to spend about a hundred bucks, is Microsoft's Interix. This makes your Windows machine look more unixy. It has a lot of unix utilities including a Korn shell. I believe it would allow the incoming [tt]rsh[/tt] from my example above. You can get Interix directly off of Microsoft's web site, but you have to hunt for it. It's not one of their bigger sellers.

Hope this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top