Skip to content

Instantly share code, notes, and snippets.

@hitesh83
Created April 1, 2018 08:54
Show Gist options
  • Save hitesh83/69ad9157346e73ffb5cf3ee5f9c62f75 to your computer and use it in GitHub Desktop.
Save hitesh83/69ad9157346e73ffb5cf3ee5f9c62f75 to your computer and use it in GitHub Desktop.
FTP mirror local to remote FTP
Finally got the answer!!! Create shell script ftpmirror.sh
#!/bin/bash
path = /local-dir-path
lftp -e "mirror -R $path /$path" -u username,password ftp-server-ip
Path = local directory which we want to copy into ftp server
username = ftp server user name
password = ftp server password
ftp-server-ip = IP address of ftp server
If lftp package is not installed the installed it using yum.
@hitesh83
Copy link
Author

#!/bin/bash
HOST='ftp.armourstationtv.com'
USER='usrname@armourstationtv.com'
PASS='password'
TARGETFOLDER='/BCT_Coach_Logs'
SOURCEFOLDER='/home/pi/ADSPL_Logs'

lftp -f "
set ssl:verify-certificate no;
open $HOST
user $USER $PASS
lcd $SOURCEFOLDER
mirror --reverse --verbose $SOURCEFOLDER $TARGETFOLDER
bye
"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment