automated file transfer?

Mark Knecht markknecht at gmail.com
Sat Sep 17 20:07:49 UTC 2005


On 9/17/05, mike <mdroz8 at gmail.com> wrote:
> hi all,
> 
> i'm a unix newbie and i'm trying to do the following...
> 
> i'm TARing up a directory, then i need to transfer this file to
> another machine.  so far i have a script to tar up the directory set
> up using crontab to run every day at a certain time.  however, i need
> to transfer this file to another machine and i was wondering if i can
> do it in ftp all in one line?  in other words, how would i automate
> logging into another machine via ftp, and transferring a file to that
> remote machine?
> 
> thx
> -m

Hi,
   Welcome.

   It would be best, if possible, not to use ftp in general as it's
pretty insecure. A better solution is to use part of ssh which does
copies. It works like like a regular cp command but goes between
machines and switches users if necessary. It goes like this:

scp path-to-local-file mark at remote-machine:path-to-remote-destination

This works well, and if you want to you can set up so that you don't
even need a password but putting keys on both sides in the proper
account. Here's one page I quickly found with the basic info on how to
do it:

http://www.phy.bnl.gov/computing/gateway/ssh-agent.html

Please note I've not looked carefully at this specific page.

This also works for complete directories so you don't have to tar if
you don't want to. man scp for more info.

Cheers,
Mark




More information about the Redhat-install-list mailing list