#!/bin/bash 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"
LCD="/z/backup/" RCD="/" EXC=1 while [ $EXC != 0 ] do lftp -c "set ftp:list-options -a; set mirror:set-permissions false; set net:reconnect-interval-max 60; set net:timeout 30s; set net:idle 10s; set net:max-retries 4; set cmd:trace yes; set cmd:verbose yes; set ftp:passive-mode on; set ftp:ssl-allow on; set ftp:ssl-protect-data on; set ftp:rest-stor false; set ftp:stat-interval 10; set ftp:sync-mode false; debug 3; open ftp://user:password@server:2121; lcd $LCD; cd $RCD; mirror --reverse \ --delete-first \ --verbose" EXC=$? done