How to synchronize your local server into remote server?
It’s my question to, I usually just copy paste from my local server to remote server, and it’s something that bored. So I found rsync (that github use), and here’s my little snippet about it.
There is 2 step to make rsync ready.
- Set up rsync daemon in your remote server.
- Use the rsync in your local server.
Also don’t forget to install rsync,
apt-get install rsync
First Step :
root$remote_server : vim /etc/rsync.d # put this line motd file = /etc/rsyncd.motd log file = /var/log/rsyncd.log pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock [simple_path_name] path = /rsync_files_here comment = My Very Own Rsync Server uid = nobody gid = nobody read only = no list = yes auth users = username secrets file = /etc/rsyncd.scrt root$remote_server : rsync --daemon
root$local_server : rsync -avz /path/to/local/folder/ email@example.com:/path/to/remote/folder/
And, your folder is synced in remote server.