Shell instance: Temporarily solve the problem of automatic disconnection of rsync

Source: Internet
Author: User
Tags rsync

Requirements: The company has two backup servers, one from the beginning, every night from the server began to synchronize some data on the main service, but rsync always disconnected, tried a lot of methods are useless, wrote a script to solve this problem, as follows

#!/bin/bashrsync-avzp--timeout=60-e "Ssh-p X" x.x.x.x:/kejiandata/streams/tarena/streams/*/hzdata/streams/while (( 1 <));d o ps aux | grep/kejiandata/streams/tarena/| grep rsync | grep timeout If [' echo $? '-eq 1];then rsync-avzp--timeout=60-e "Ssh-p X" X.x.x.x:/kejiandata/streams/tare na/streams/*/hzdata/streams/fi Sleep If [' Date + '%h%m '-ge 0830];then exit Fidone


This article is from the "Court of the Odd Tree" blog, please be sure to keep this source http://zhangdl.blog.51cto.com/11050780/1866710

Shell instance: Temporarily resolves an issue with rsync auto-disconnection

Related Article

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.