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

West Plains Hosting: $4/month/1GB RAM/40GB storage/5TB bandwidth/Xen/Atlanta

West Plains Hosting, which seems to be a newly es...

AlphaRacks: $48/year/2GB memory/100GB space/3TB traffic/1 IP/OpenVZ

AlphaRacks has launched a special VPS with large ...

Digiturunc: $13.5/month/2GB memory/30GB space/2TB traffic/KVM/Türkiye/Romania

Digiturunc, a Turkish merchant, was established i...

BitTorrent Deluge WebUI Installation For Debian/Ubuntu

Deluge is a BitTorrent client based on libtorrent...

SecureDragon: $18/year/4GB memory/100GB space/10TB traffic/KVM/Tampa

SecureDragon, first introduced in April 2012, was...

WootHosting: $12/year/100GB space/2TB traffic/Los Angeles

WootHosting, an American hosting provider, was fo...

IonSwitch: $15/year/1GB memory/10GB SSD space/1TB traffic/1Gbps port/KVM/Dallas

IonSwitch, a hosting provider established in Febr...

Ramnode vps discount code long-term update

Ramnode related information: 1. Ramnode VPS detai...