Skip to content

Instantly share code, notes, and snippets.

@nLight
Created January 25, 2013 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nLight/4631937 to your computer and use it in GitHub Desktop.
Save nLight/4631937 to your computer and use it in GitHub Desktop.
LFTP Mirror script
#!/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