Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # !/bin/bash
- protocol="ftp"
- host=""
- user=""
- pass=""
- now=$(date +"%m%d")
- localcd=""
- remotecd="///$now"
- ftpurl="$protocol://$user:$pass@$host"
- include="--include-rx-from=musthave.txt"
- excludes="--exclude-glob .*"
- excludes+=" --exclude-glob .*/"
- excludes+=" --exclude-glob *.date"
- excludes+=" --exclude-glob *.bad"
- excludes+=" --exclude-glob *.missing"
- excludes+=" --exclude-glob *.message"
- excludes+=" --exclude-glob (no-sfv)*"
- excludes+=" --exclude-glob (no-nfo)*"
- excludes+=" --exclude-glob (incomplete)*"
- excludes+=" --exclude-glob *[*COMPLETE*]*"
- lftp_sets="set cmd:fail-exit yes;"
- if [ "$protocol" == "ftp" ]
- then
- lftp_sets+=" set ftp:ssl-auth TLS;"
- then
- lftp_sets+=" set mirror:use-pget-n 2;"
- fi
- lftp -e "$lftp_sets
- open '$ftpurl';
- lcd $localcd;
- cd $remotecd;
- mirror --continue --only-newer --loop --verbose=3 --no-perms --parallel=2 $includes $excludes"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement