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:
- Create the .lftp directory with the command : mkdir /root/.lftp
- Create and edit the rc file with the command : vi /root/.lftp/rc
- Press ‘i’ for edit mode
- Add the line : set ssl:verify-certificate no
- Exit edit mode by pressing Escape (twice)
- 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