LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   automate ftp (non-GUI) (https://www.linuxquestions.org/questions/linux-software-2/automate-ftp-non-gui-317511/)

prx 04-26-2005 08:31 PM

automate ftp (non-GUI)
 
Hello!

I have a directory which folders containing files get put into by various users on server1:

/pub/public/outgoing

so inside /pub/public/outgoing, there could be subdirectories and other subdirectories within those subdirectories.

Everything that gets put in this directory, I want to send via ftp to server2 with a real login username and password that is required on server2, recreating all those same directories, subdirectories, and files.

I DO NOT want to tar these files up first, because I do not have the ability to untar them on server2.

SO.....

I am looking for a script or some advice on pulling this off. I would like to run a cron job to move this stuff from server1 to server2, then rm or move to tmp the files which have been ftp'd to server2.

Thanks for any advice you can give in advance!

Something out there must already do this, I'm just not finding what I'm looking for.

-prx

ilikejam 04-26-2005 09:14 PM

Hi.

I do this to keep my website updated
Code:

#!/bin/bash
cd /pub/public/outgoing
lftp -c 'open -u USERNAME,PASSWORD SERVER2; mirror -R -e -L; quit'

And that's about it. Have a look at 'man lftp' to see exactly what the mirror arguments do.

Dave


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