Backup My Website to Synology via LFTP

There is no FTP in Synology, so I have to use LFTP

Here is my backup.sh

#!/bin/bash -vx
lftp -u username,password ftp.xxx.com<<END_SCRIPT
mirror -c -e –parallel=10 /remote_address /destiny_address
exit
END_SCRIPT

 

If you see “lftp –> Fatal error: Certificate verification: Not trusted” , you can follow this link or the steps below to fix it:

  1. Create the .lftp directory with the command : mkdir /root/.lftp
  2. Create and edit the rc file with the command : vi /root/.lftp/rc
  3. Press ‘i’ for edit mode
  4. Add the line : set ssl:verify-certificate no
  5. Exit edit mode by pressing Escape (twice)
  6. Close and save the file by pressing Z (capital z) twice)

 

After that I use Synology Task Scheduler to backup my website regularly,

backup.sh | tee -a logfile.text

Leave a Comment