FTP Automatic backup VPS script in Linux

Source: Internet
Author: User
Tags vps vps providers

Server more, the site is more and more, always feel not the whole backup heart, and there are several times RM operation errors, resulting in irreparable damage. And most VPS providers are not providing automatic backup functionality or this feature charges slightly higher prices. So it is necessary for me to put this work into practice, and maybe one day it will be used.

Use of the backup space I am using GoDaddy online Storage, the advantage is that my VPS are the United States service providers, choose GoDaddy space transmission speed is more assured that the most critical price can also be accepted, 100G space less than 30 dollars a year, In view of the current U.S. dollar rate on the renminbi, this price I think has been quite favorable.

The script is very simple, you can modify the relevant content according to their needs, here the main reference to the Linux VPS Automatic backup: Script upload FTP and rsync incremental backup, I mainly for the Debian system slightly adjusted a sentence, we can refer to the

First you need LFTP installation:

The code is as follows Copy Code
# yum-y Install Lftp

Make sure it's ready! (Available lftp-v detection)

The code is as follows Copy Code
Then VI backup.sh

Then copy the code and modify your host-related parameters and passwords:

Script Download: https://github.com/nonozone/TEMP/blob/master/AutoBackupToFtp.sh

To add execute permissions to a script:

The code is as follows Copy Code

chmod +x/root/backup.sh

Use System crontab to achieve automatic daily operation:

The code is as follows Copy Code

Crontab-e

Enter the following content:

The code is as follows Copy Code

0 1 * * */root/backup.sh

Of these, 0 1 is the time division/hour, can be modified by itself, for example: 30 12 * * *, is to run the script 12:30 every day.

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.