Created
November 15, 2022 09:41
-
-
Save philipp-r/818e0d36dfd3a994a8a9d5f4042047a7 to your computer and use it in GitHub Desktop.
Backup files from FTP with lftp to a local folder
This file contains hidden or 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/user/backup' | |
lftp -f " | |
open $HOST | |
user $USER $PASS | |
lcd $REMOTEFOLDER | |
mirror --exclude data/cache/ data/temp/ data/logs/ --continue --delete --verbose $REMOTEFOLDER $LOCALFOLDER | |
bye | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment