How to use dropbox in CentOS 6.x and regularly synchronize data

Source: Internet
Author: User
Tags centos python script

1. Install Dropbox
32-bit
Wget-O-"https://www.dropbox.com/download? Plat = lnx. x86 "| tar xzf-
64-bit
Wget-O-"https://www.dropbox.com/download? Plat = lnx. x86_64 "| tar xzf-
Run the dropbox daemon from the New. Dropbox-dist folder.
~ /. Dropbox-dist/dropboxd
There will be a link, you need to log on to the web page to confirm to associate this device
Please visit https://www.dropbox.com/cli_link_nonce? Nonce = 00873e432b668e9c6637642850a7edce to associate with this device.

Use the official Python script to control Dropbox through command lines
Mkdir-p ~ /Bin
Wget-O ~ /Bin/dropbox. py "https://www.dropbox.com/download? Dl = packages/dropbox. py"
Chmod + x ~ /Bin/dropbox. py

2. Get help
~ /Bin/dropbox. py help

Which will show you all the commands you can use

Status to get the running status of dropboxd
Help
Puburl obtains the shared link of an object.
Stop dropboxd
Running returns whether dropboxd is running
Start to run dropboxd
Filestatus: obtains the synchronization status of one or more files.
Ls displays the synchronization status of files (folders)
Autostart automatically starts dropboxd upon logon.
Exclude exclusion folder during synchronization
Enable Lan sync

~ /Bin/dropbox. py status
~ /Bin/dropbox. py statrt
~ /Bin/dropbox. py exclude list
~ /Bin/dropbox. py exclude add ~ /Dropbox/blogkms

3. Unbind Dropbox
If your host is changed, the original Dropbox is definitely not needed. Unbind the association between your account and bropbox.
Log on to your account on the official website
Click your name in the upper right corner
Find settings in the drop-down menu)
Select security tab
Find the device (devices) under the webpage)
Click X next to the device to unbind it.

Delete all related files on the linux host (note backup)
Rm-rf ~ /. Dropbox Dropbox. dropbox-dist

4. Boot
Vi/etc/rc. local
Su-xxx-c "~ /Bin/dropbox. py start "# su-root-c "~ /Bin/dropbox. py start"
# Xxx: Your username

Run at and every day, and then stop running after 15 minutes.
# Dropbox
, 12 *** sh ~ /Dropbox. sh start
, 12 *** sh ~ /Dropbox. sh stop

5. Back up data
Vi backup. sh

#! /Bin/sh
# Create a/root/Dropbox/blogkms backup folder in advance
BpDIR = "/root/Dropbox/blogkms"
ScDIR = "/data/wwwroot"
CfDIR = "/usr/local/nginx/conf"
Rm-rf "$ bpDIR/web. $ (date-d-10day + % Y. % m. % d.) * .tar.gz"
Rm-rf "$ bpDIR/conf. $ (date-d-10day + % Y. % m. % d.) * .tar.gz"
Rm-rf "$ bpDIR/SQL. $ (date-d-10day + % Y. % m. % d.) *. SQL"
# Delete the data backed up 10 days ago

Tar zcvf "$ bpDIR/conf. $"
# Backing up nginx configuration files

Tar zcvf "$ bpDIR/web. $ (date when policy.w.m.20.d.w.h.20.m.20.s=.tar.gz" -- exclude = SuHu "$ scDIR"
# Backing up website files

/Usr/local/mysql/bin/mysqldump-ublog-pGUIOygC7xivA -- databases blog> "$ bpDIR/SQL. $ (date + % Y. % m. % d. % H. % M. % S ). SQL"
# Backing up database files

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.