28mrt/100
How to sync files to a ftp server with the use of ftpsync on FreeBSD
In the ports of FreeBSD I found a nice tool to sync a local directory to a remote FTP server.
First install ftpsync:
cd /usr/ports/ftp/ftpsync make install clean
Next create a config file to configure ftpsync for synchronization:
localdir=/home/mariusvw/backups ftpserver=rstore.kitara.nl ftpdir=/ ftpuser=username ftppasswd=password
Next you have two options for syncing...
Get-sync from server:
ftpsync.pl -g cfg=financenetwerk_eu-v1.cfg
Put-sync to server:
ftpsync.pl -n cfg=financenetwerk_eu-v1.cfg
You can add the -p flag to not-prune directories on the target.
I don't use this program anymore for syncing but I can tell you, it works great if you want to easy upload a website to a live server.
24mrt/100
How to use Bash to upload a file via FTP
This script is a simple example how you can use BASH to upload one or more files to a FTP server.
if [[ "${debug}" = "YES" ]]; then verbose="-v" else verbose="-V" fi ftp -i -n -q 10 "${verbose}" < <EOF open "${ftp_host}" "${ftp_port}" quote USER "${ftp_user}" quote PASS "${ftp_pass}" quote CWD "${initial_directory}" binary put "${file}" "${file_name}" quit EOF
Another script that I wrote on a boring evening. I don't use it these days anymore but it might be useful for you




