automated ftp

where can I find a script that will allow me to automate, on
a configurable schedule, ftp transfers?  I am not good at
programming so I need a pre-existing script.
kenny45121899Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
mpassConnect With a Mentor Commented:
This script will do what you want:

#!/bin/ksh

u=username
p=password

while 1
ftp -in systemname << eof_ftp
    us $u $p
    bin
    cd /foo/bar/
    get filename
    quit
eof_ftp
exit

Change the following:
username and password to the username and password you will be logging in with on the ftp server.

systemname to the name of the ftp server.

cd /foo/bar to the directory where the file you want is located.

filename to the name of the file you want to transfer.

To automate this script, create a crontab entry and set it for whatever time you want. One last thing, make sure this file is executable and only readable by you with a 'chmod 700'. This is important because the username and password have to be stored in the script for it to work. If you have problems, please leave a comment. Thanks.
0
 
freelonCommented:
What is it you really want?  :)  Do you want to download a certain file every day, or do you want to say "this is the file I want, now download it at 11:14pm next Tuesday"?
0
 
EatEmAndSmileCommented:
I believe you'd like something like "GetRight" for Linux, right? Well... Your solution is the "wget" program. It comes with Slackware, but I don't know if you were lucky enough to get Slackware as your distribution. You could download it, anyway.

 With wget, you can write a text file containing the URLs of the files you want, then configure cron to run it at a given time. wget wil then read your list and download the files, one by one. It is even better if you get demand dialing set up, so the connection will be automatically done.

 I'll give more instructions if this sounded interesting...
0
All Courses

From novice to tech pro — start learning today.