Created
January 25, 2013 05:09
-
-
Save nLight/4631937 to your computer and use it in GitHub Desktop.
LFTP Mirror script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# http://serverfault.com/questions/24622/how-to-use-rsync-over-ftp/106365#106365 | |
HOST="your.ftp.host.dom" | |
USER="username" | |
PASS="password" | |
LCD="/path/of/your/local/dir" | |
RCD="/path/of/your/remote/dir" | |
lftp -c "set ftp:list-options -a; | |
open ftp://$USER:$PASS@$HOST; | |
lcd $LCD; | |
cd $RCD; | |
mirror --reverse \ | |
--delete \ | |
--verbose \ | |
--exclude-glob a-dir-to-exclude/ \ | |
--exclude-glob a-file-to-exclude \ | |
--exclude-glob a-file-group-to-exclude* \ | |
--exclude-glob other-files-to-esclude" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment