Remote Automatic Backup rsync + ssh + sshpass

Source: Internet
Author: User

Remote Automatic Backup rsync + ssh + sshpass: the advantages of mutual automatic backup between remote servers (www.2cto.com rsync) The vast majority of O & M personnel know that, simply put, only the files that have been modified are backed up, reduce data transmission volume. At the same time, it can transmit data through the ssh protocol for data security. However, ssh has a disadvantage. Only the password can be entered in interactive mode. As a result, the backup program cannot be written to crontab and can only be executed manually. Automatic batch processing is not supported. And sshpass can decrypt this disadvantage, let us look at the specific: http://sourceforge.net/projects/sshpass/files/ decompress. /configure; make install to complete installation and use: www.2cto.com sshpass-p 'Password' rsync-av-e ssh localdir username @ remoteaddr:/remotedir or sshpass-f password. file rsync-av-e ssh localdir username @ remoteaddr:/remotedir where: password remote server password www.2cto.com password. file Content is password file localdir local directory to be backed up username Remote Server username remoteaddr Remote Server IP or remote server domain name remotedir remote server path ps: the rsync exclusion directory syntax is -- explode = directory name. In actual tests, the directory name cannot be an absolute address.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.