Linux timed backup data to Baidu Cloud disk

Source: Internet
Author: User
Tags php download

Guide: Today's Baidu Cloud disk free capacity is 2 T, even if the computer all the stuff on the put up, there are plenty of space left. For the webmaster, is fully able to make full use of these hard disk space, now we use Baidu Cloud disk to back up the data on the Linux server. have been thinking, if the Baidu Cloud disk support FTP is good, you can implement the Linux scheduled backup data to Baidu Cloud disk. In particular, the capacity of each cloud disk reached the T-level, but also a kind of wasteful feeling.  Yesterday inadvertently found a script, you can implement Linux scheduled backup data to Baidu Cloud disk. Installation Bpcs_uploader Although there are many tutorials on bpcs_uploader, they are all stereotyped. Although there are very detailed tutorials on the web, there may be some missing details. Don't say much nonsense, start. Download package: wget https://Github.com/oott123/bpcs_uploader/zipball/masterDecompression: Unzip master default folder name is very long, in order to facilitate later operation, rename folder: MV oott123-bpcs_uploader-3a33d09 Baidu Here I changed the folder name to Baidu, it is important to note that the default folder name may be different later, after all, the program will be upgraded, you need to look at the extracted folder name is what. Go to program directory: CD Baidu set permissions: chmod+x bpcs_uploader.php Run the program:./bpcs_uploader.php You may see an error prompt, because the PHP environment is required to run the program, and the PHP path on your server may be different from the one set in the program, modify the PHP path in the program file bpcs_uploader.php. View PHP Path: Which php edit bpcs_uploader.php file: VI bpcs_uploader.php will be the first sentence #After the path is modified to your PHP path, if you install the WDCP one-click Package, the path is:/www/wdlinux/php/bin/PHP login Baidu Developer Center: http://developer.baidu.com/Create a web app, apply a name customization, for example: Huihuige, other default settings are available. At this point, we can get the API Key for the app to run./The first thing to enter after Bpcs_uploader.php is key. In addition, we will find API management in application management, open the PCs API, set up a directory that will be used to store the data uploaded by the server. Tip: The directory you set when you turn on the PCs API is not changed, but you can remove app rebuilds from the Actions menu. After entering key, the next step is to enter the app Floder name, which is the directory name that was set when the PCs API was just turned on. Then you need to enter access token, fill in your key in the following address location, in the browser open the resulting address: https://Openapi.baidu.com/oauth/2.0/authorize?response_type=token&client_id=key&redirect_uri=oob&scope =netdiskthen you will see a write "Baidu Oauth2."0"page, copy the URL from the browser address bar to find access_token= and &the string between, this is access token, after entering access token is completed, you will see the SSH terminal shows your Baidu cloud disk capacity. If you have previously installed Bpcs_uploader, you can perform the following command initialization:./bpcs_uploader.php initbpcs_uploader Usage Query capacity:./bpcs_uploader.php Quota Upload file:./bpcs_uploader.php upload [path_local] [path_remote][path_local] refers to the file path on the server, [Path_remote] refers to the path of the Baidu cloud disk. Download file:./bpcs_uploader.php Download [path_local] [path_remote] Delete file:./bpcs_uploader.php Delete [path_remote] offline download:./bpcs_uploader.php Fetch [Path_remote] [Path_to_fetch] Automatic backup script next need to set up automatic backup data, there are many automated backup scripts online, so I will not repeat. This is to say that, since most of us have installed the Control Panel on the Linux server, and the control Panel has the function of automatically backing up the data, such as WDCP can set up the automatic backup data to/www/Backup directory, then we no longer need to automatically back up the data of the script, only a script to the backup directory of all the files uploaded to the Baidu cloud disk. Download script to the Baidu directory: wget http://Www.huihuige.com/wp-content/uploads/2013/10/baidubd.zipDecompression: Unzip baidubd.zip This script is useful for WDCP panel users, if your backup directory is different, you can open the script modification. Test script is valid: SH baidubd.sh last set scheduled task: Crontab-e Add a line:0 0* * * */root/baidu/baidubd.sh here set a daily 0 o'clock in the morning automatic backup data to the Baidu cloud disk. 

Linux timed backup data to Baidu Cloud disk

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.