Created
April 1, 2018 08:54
-
-
Save hitesh83/69ad9157346e73ffb5cf3ee5f9c62f75 to your computer and use it in GitHub Desktop.
FTP mirror local to remote FTP
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
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#!/bin/bash
HOST='ftp.armourstationtv.com'
USER='[email protected]'
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
"