I have a ftp location and I need to write shell script to mirror it in a specific interval. I will set the timer with Linux cron but how can I use ftp to mirror the remote folder with my local folder.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try using this…..
#!/bin/bashHOST='172.13.17.11'USER='username'PASS='password'TARGETFOLDER='/mnt/htdocs/businessfiles/files'SOURCEFOLDER='/somefolder'lftp -f "open $HOSTuser $USER $PASSlcd $TARGETFOLDERmirror --verbose $SOURCEFOLDER $TARGETFOLDERbye“`