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

Aperture 1GB RAM 500Mbps Bandwidth Hong Kong Lightweight VMware VPS Review

Details : Aperture: 66.5 yuan/month/512MB memory/...

Hetzner: €20/month/i7-2600/16GB RAM/6TB HDD/20TB bandwidth/Germany

Hetzner, a long-established German hosting provid...

W3Space: $7/month/2GB memory/30GB space/3TB traffic/1 IP/KVM/Los Angeles

W3Space. Founded in 2013, it has been introduced ...

$7/month/1024M/25G space/1000G traffic/OpenVZ VPS —— PieServ

PieServ is a VPS provider that was founded in 201...

SingleRack: $4.99/month/50GB space/unlimited traffic/dedicated IP/Singapore

SingleRack is an Indonesian hosting company that ...

clouvider i3-3240 4GB memory 1Gbps bandwidth UK independent server review

Details: clouvider: UK exclusive server, minimum ...

Host Honey: $120/year/i3-2120/8GB memory/500GB space/20TB traffic/West Virginia

Host Honey, which was first introduced on this si...

Prometeus: €7.5/month/2GB RAM/50GB SSD space/10TB bandwidth/KVM/Italy

Prometeus, founded in 1997, is a long-established...

LEB 2013 Q4 Excellent VPS Ranking and Promotion

RamNode (243 votes)優惠碼:SOMUCHLOVE(可優惠42%) 512MB R...

BandwagonHost 2GB RAM 1Gbps Bandwidth Los Angeles CN2 GT (DC3) KVM VPS Review

We plan to evaluate the VPS in each of BrickLink&...