Use FTP in Shellscripts
 
I wrote this little script to copy backups over ftp regularly. It can be executed with a cronjob.
In the first part of the script, you can enter info about your ftp connection (server, user, password) and the file you want to copy.

#!/bin/bash

HOST='ftp.host.com'
USER='userhere'
PASSWD='passwordhere'
FILEPATH='/path/to/file/'
FILE='file.ext'

cd $FILEPATH
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
binary
put $FILEPATH$FILE $FILE
quit
END_SCRIPT
exit 0
 
admin / Oct 31, 2004
   
 
 
Login: 
Pass: 
 
 
     
     
2004 - 2017 / lookass.ch
makememad@lookass.ch