Created
August 19, 2015 15:48
-
-
Save james2doyle/5f10480d597111f69b9d to your computer and use it in GitHub Desktop.
LFTP Mirror settings
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 | |
HOST="0.0.0.0" | |
USER="ftpusername" | |
PASS="ftppassword" | |
PORT="21" | |
FTPURL="ftp://$USER:$PASS@$HOST:$PORT" | |
LCD="$(pwd)" # pwd returns the directory you are working in | |
RCD="/nested-remote-directory" | |
#DRYRUN="--dry-run" | |
#DELETE="--delete" | |
#EXISTING="--only-existing" | |
#GLOBS="--exclude-glob a-dir-to-exclude/ \ | |
# --exclude-glob a-file-to-exclude \ | |
# --exclude-glob a-file-group-to-exclude* \ | |
# --exclude-glob other-files-to-exclude" | |
SSL="set ssl-allow true; | |
set ssl:verify-certificate no;" | |
lftp -c "set ftp:list-options -a; | |
$SSL | |
open '$FTPURL'; | |
lcd $LCD; | |
cd $RCD; | |
mirror --reverse \ | |
$DRYRUN \ | |
$DELETE \ | |
$EXISTING \ | |
--verbose \ | |
--use-cache \ | |
$GLOBS \ | |
--only-newer" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment