Data synchronization method on VPS

Data synchronization method on VPS

This method comes from the Internet. I have been using it for a month, but because I reinstalled the VPS, I synchronized it quite a few times. It was successful every time with no problems at all.
VPS synchronization is different from ordinary client computers and has no interface, which requires a client under the Linux command line.
And the great Dropbox has this feature. Without further ado, let's look at the steps (mostly copied from the Internet):
PS: Since Dropbox is blocked, your VPS has to be located abroad, that is, outside the Great Firewall, of course, most of them are. There are not many people using domestic VPS.
wget -O dropbox.tar.gz http://www.dropbox.com/download/?plat=lnx.x86
tar -zxof dropbox.tar.gz
~/.dropbox-dist/dropboxd &
After the command runs in the background, a string of URL addresses will appear continuously, prompting you to visit this URL address to bind your Dropbox account. Copy and paste this URL into your browser and run it. It will ask you to enter your Dropbox account to bind the VPS to your Dropbox account.
Of course, you have to register a Dropbox account in advance. Of course, to register for Dropbox you have to go over the wall first.
After you visit that URL and bind your account, the terminal will no longer pop up that URL address, and it will prompt something like shell not found. Ignore it and end it by pressing ctrl+c.
The /root/Dropbox directory will then be created.
All files in this directory will be synchronized to the server. Of course, you don't have to copy all the files you want to synchronize to this directory, just make a connection. For example, I want to synchronize all the files in my www directory to the server:
cd /root/Dropbox
ln -s /var/www www-2010-11-11 (A folder named www-2010-11-11 will be generated on the server, which contains all the files under www.)
It's that simple. I also synchronized the mysql database files to the server without exporting them into sql tables.
Of course, to synchronize, you have to let the Dropbox service run in the background.
/root/.dropbox-dist/dropboxd &
Just add the command to the system startup items. The blog I read also mentioned that because it takes up a lot of memory, you can write a script to have it run and shut down at a scheduled time. For script experts, this is a piece of cake.
But when I use it, maybe because my data is small (less than 100M), I feel that it does not use much memory. It keeps it running.
The following replication schedules to run and shut down:
Create a script in ~/.dropbox/:
#!/bin/sh
start() {
echo starting dropbox
/root/.dropbox-dist/dropboxd &
}
stop() {
echo stoping dropbox
pkill dropbox
}
case “$1″ in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
esac
Modify script permissions:
chmod 755 ~/.dropbox/dropbox.sh
Create a scheduled task:
crontab –e
Add two items:
0 1 * * * sh /root/.dropbox/dropbox.sh restart
0 6 * * * sh /root/.dropbox/dropbox.sh stop
:wqSave, and Dropbox will automatically run at 1:00 am and shut down at 6:00 am every day.
How to delete dropbox:
/root/.dropbox/dropbox.sh stop
# rm -rf .dropbox .dropbox-dist Dropbox dropbox.tar.gz dbmakefakelib.py dbreadconfig.py
Dropbox registration address: www.dropbox.com (You still need to Go out of wall here)
98% of the content of this article is reproduced from: http://www.laogeng.org/archives/1204.html
Reprinted from: http://err99.in/archives/339

<<:  8 Free Twenty Eleven Child Themes

>>:  Introduction to American Virpus VPS Hosting Provider

Recommend

ServersGet: $49/month/E3-1270/8GB memory/500GB space/10TB traffic/Netherlands

ServersGet, a Dutch hosting provider, has 10 year...

Ho-ost: $25/year/1GB memory/10GB space/500GB traffic/KVM/North Carolina

Ho-ost, a foreign hosting provider, has been quit...

Cheap .XXX Domain Name Deals in May

First, DYNADOT $9.99 DYNADOT is one of my favorit...

BudgetVM: $29/month/4GB memory/250GB space/5TB traffic/5 IP/KVM/Los Angeles

BudgetVM has some high-configuration KVM VPS with...

WeLoveServers: $6/year/128MB/10GB space/1TB traffic/OpenVZ/Los Angeles

WeLoveServers, this time the discount, the traffi...

Netfirms .com domain name discount: $1.39/first year

Netfirms .com domain name discount: $1.39/first y...

PioHost: $12.5/year/1.5GB memory/50GB space/1TB traffic/OpenVZ/UK

PioHost is a registered hosting company in the UK...

Linux One-click Network Reinstallation Linux / Windows System

Previously, I mainly used Mengka Vicer's netw...

DNSZi: Free DNS management in Korea with domain forwarding support

DNSZi is a free DNS service site under PHPSCHOOL,...

PulseHeberg: €5/month/2GB RAM/250GB storage/unlimited traffic/OpenVZ/France

PulseHeberg, founded in 2012, is a French hosting...