Little script for that that can be useful, mirror a local directory to distant with given configuration @ beginning of script
#!/bin/bash
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#
# DESCRIPTION: Mirrors local site and remote site
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
FTP_HOST=aFtpHost.org
FTP_USER=YourUserHere
FTP_PWD=yourPasswdHere
LOCAL_SOURCE_PATH=/home/myName/locations/music/${1} #param 1 from script for example
REMOTE_DEST_PATH=/htdocs/aDirectory
EXCLUDE_FILES_LIST=".svn empty anotherDirectory"
# Construct excludes
for exclude in ${EXCLUDE_FILES_LIST}; do
EXCLUDES="-x ${exclude} ${EXCLUDES}"
done
# -R, --reverse reverse mirror (put files)
# mirror -e
#--delete delete files not present at remote site
lftp ftp://${FTP_USER}:${FTP_PWD}@${FTP_HOST} -e "mirror ${EXCLUDES} -R ${LOCAL_SOURCE_PATH} ${REMOTE_DEST_PATH} ; quit"