Unix questions - How to ftp (upload) a whole directory by script automatically?

This is Interesting: Free IT Magazines  
Home > Archive > Unix questions > August 2006 > How to ftp (upload) a whole directory by script automatically?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to ftp (upload) a whole directory by script automatically?
wavelet.liu@gmail.com

2006-08-02, 1:23 am

I want to schedule one cron job to do it in unix to upload one
directory
to remote server. I know some basic script to transfer one file is
like:

ftp -n <<EOF
open host
user username password
cd somewhere
(...)
get file
put file
(...)
quit
EOF

How about the whole direcory?

--Wavelet

Bill Marcum

2006-08-02, 1:23 am

On 1 Aug 2006 19:01:03 -0700, wavelet.liu@gmail.com
<wavelet.liu@gmail.com> wrote:
> I want to schedule one cron job to do it in unix to upload one
> directory
> to remote server. I know some basic script to transfer one file is
> like:
>
> ftp -n <<EOF
> open host
> user username password
> cd somewhere
> (...)
> get file
> put file
> (...)
> quit
> EOF
>
> How about the whole direcory?
>

The simplest way is to tar the directory and put it as one file, or you
can use rsync if it is installed on both machines.


--
Talking much about oneself can also be a means to conceal oneself.
-- Friedrich Nietzsche
Chuck Dillon

2006-08-02, 1:28 pm

wavelet.liu@gmail.com wrote:

> I want to schedule one cron job to do it in unix to upload one
> directory
> to remote server. I know some basic script to transfer one file is
> like:


Look at the ftp command mget.

-- ced

>
> ftp -n <<EOF
> open host
> user username password
> cd somewhere
> (...)
> get file
> put file
> (...)
> quit
> EOF
>
> How about the whole direcory?
>
> --Wavelet
>



--
Chuck Dillon
Manager of Software Development, Bioinformatics
NimbleGen Systems Inc.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com