How do I back up via FTP and rsync?
Matthew Harrington
I am new to these backup things. I have try Backuppc and rsnashot. Backuppc was cool, with web frontend.
My probleam: I don't have any backup servers I just have server and ftp-disk. I wanted to backup my server to ftp-disk, but I'm not sure how to do it? Can I use rsync?
25 Answers
Another solution, if you have lftp:
lftp -e "mirror -R src_local_folder dest_folder_on_ftp_server; exit" -u ftp_user[,ftp_pass] ftp_serverSupport SSL/TLS
you can mount the ftp resource as a local
curlftpfs [user@]host:[dir] mountpoint [options]and use rsync as to local directories
rsync works over ssh, but not over FTP. Full discussion here:
(Short answer in case serverfault ever goes down: you can't. Try lftp.)
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" Another solution you might want to look into is a package called backup-manager ().
This is a great script and lets you leverage multiple back up methods. Rsync, SSH, FTP, and even Amazon S3. Very simple to configure and you
You can do a aptitude search backup-manager to get more information