auto ftp upload and download

Sometimes we need to upload and download files from ftp, waiting a file complete is a terrible thing. Let’s do ot automatically!


Sometimes we need to upload and download files from ftp, waiting a file complete is a terrible thing. Let’s do ot automatically!

Scripts to download files from Server:

!/bin/bash
ftp -v -n 192.168.1.171
user guest 123456
binary
cd /home/data
lcd /home/databackup
prompt
mget *
close
bye

Scripts to upload files to FTP server:

#!/bin/bash
ftp -v -n 192.168.1.171 << END user guest 123456 binary hash cd /home/data lcd /home/databackup prompt mput * bye END

Leave a Reply

Your email address will not be published. Required fields are marked *