Created
June 23, 2023 07:26
-
-
Save philipp-r/4393e8002bfc61adfab6c2c1c7a417cd to your computer and use it in GitHub Desktop.
Mirror files from FTP server to local server (here to backup the Dokuwiki)
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='ftp.example.com' | |
USER='username' | |
PASS='password' | |
REMOTEFOLDER='/var/www' | |
LOCALFOLDER='/home/backup/ftpcopy' | |
lftp -f " | |
open $HOST | |
user $USER $PASS | |
lcd $REMOTEFOLDER | |
mirror --exclude data/cache/ --exclude data/index/ --exclude data/locks/ --exclude data/tmp/ --continue --delete --verbose $REMOTEFOLDER $LOCALFOLDER | |
bye | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment