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