Cron job for transferring files from one FTP server to another

Confused

Elite Member
Nov 13, 2000
14,166
0
0
I've got some files which are uploaded to an FTP server, and I need to transfer them to another FTP server on a regular basis.

The "host" FTP server (where the files are going FROM and where I will be running Cron from) is my linux-based webhost.

Can anyone help a linux/cron noob out :)


Cheers!


Confused
 

Confused

Elite Member
Nov 13, 2000
14,166
0
0
Bump + Subscribe + More information :)


The server is running Red Hat 9, kernel version 4.2.20-30.9smp, if that makes any difference/help :)


Garry
 

groovin

Senior member
Jul 24, 2001
857
0
0
as mentioned, a shell script run by cron is probaly the way to go...

i dont run any ftp servers any more, but when i need to move stuff on servers around, i like using rsync... theres plenty of docs on it. The data is encryted with ssh so the data is pretty safe in transit... but rsync would be another daemon you have to monitor for patches, upgrades etc.

 

drag

Elite Member
Jul 4, 2002
8,708
0
0
If your only using it inside a lan (the only really good place for automated ftp transfers) and security isn't a big deal....

You could set up a ftp server on the computer you want to backup and then run a wget script from the backup machine...


wget ftp://Username:Password@your.ip.address.here/path/to/files/*


That would be the simplist way to do it, but DEFINATELY not the best. I can think of a dozen different possibilities, some lots more complicated, most of them a lot more safer.

If the information isn't sensitive then setup a anonymous ftp user with no password for read-only access to the directory you want to backup from. I think that would be OK for internet use.

You could also probably pipe into a tar command to tarball it and compress it for easier storage.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Are you having problems actually ftping the data, or setting up cron, or have you no clue on where to start?

Read up on .netrc. You can store ftp information (host, username, password, and I think directories) there. It makes automated FTP easy, although I haven't messed with it in a while.
 

Confused

Elite Member
Nov 13, 2000
14,166
0
0
Originally posted by: n0cmonkey
Are you having problems actually ftping the data, or setting up cron, or have you no clue on where to start?

Read up on .netrc. You can store ftp information (host, username, password, and I think directories) there. It makes automated FTP easy, although I haven't messed with it in a while.

I have no clue where to start :eek:

Thanks to everyone else, those links etc were very interesting, but it's still wayyy over my head!

n0c, i'll try to have a look :)


Garry
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Confused
Originally posted by: n0cmonkey
Are you having problems actually ftping the data, or setting up cron, or have you no clue on where to start?

Read up on .netrc. You can store ftp information (host, username, password, and I think directories) there. It makes automated FTP easy, although I haven't messed with it in a while.

I have no clue where to start :eek:

Thanks to everyone else, those links etc were very interesting, but it's still wayyy over my head!

n0c, i'll try to have a look :)


Garry

Look for a manfile for .netrc, or search google. I know I found some good information when I was looking for it, but my mind is pretty much fuzzled for the night.

Are these your boxes (you or a co-worker have root access) or are you renting space somewhere?

Unpriviledged scp using keys without passphrases might be a "better" solution. Shouldn't use the root account like that though.