Linux automatic backup of remote data via scripting

Source: Internet
Author: User

With the rapid development of data, regular backup of data has become the primary consideration of data security. If there is a problem or failure, so that the data can not be read properly, then the original important data how to save it. Of course, you can not use the local backup, such a large risk of backup, it is very likely to Jifeidanda, if the machine is down, the local backup data can not be used. Therefore, it is important to take a remote server as a backup machine ( remote Data backup ).

Remote manual backups are laborious and time-consuming, and the best way to do this is to automate remote backups via scripting. However, remote backup is usually logged to the Business Server (data server) through the SSH method, and it is said that you need to enter the login password continuously when you copy files through SCP. In order to solve this problem can use "SSH certificate login mode" to implement SSH without entering a password to login. Having said so much nonsense, start doing it one step at a time.

1. Configure "SSH certificate logon method (no password Authentication login)"

※ specific configuration, please see SSH certificate Login method (no password Authentication login)

2. Edit the Crontab file

※crontab is a command under Linux, located in/etc/crontab, used to execute the specified script at a specified time, i.e., timed to a task.

If you set the script in cron.daily to execute 1:00 every day:

XX 1 * * * Root run-parts/etc/cron.daily

3. Edit the Automatic backup script

Put the script in the/etc/cron.daily/directory

      CD   /etc/cron.daily/      VI bakeup_script      


Cond......



Linux automates automatic backup of remote data through scripting

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.