quick rsync how to…
Working in Linux servers sometimes makes it inevitable to use rsync to move and synchronize files from one server to another. This is where rsync excels as it does not only moving of files but also incremental synchronization between two servers. It's also great tool to backup files to a remote server when used in conjunction with cron to automate it. Most new installation may not have it installed on their boxes, in debian it is as easy as typing
apt-get install rsync
to install the latest version.
Once installed you'll need two servers to properly test it. First of all, as you are accessing other server you will need an account on all servers. Also, since rsync doesn't have secure transfer by default, make sure to install open-ssh on both servers to transfer files securely.
Some common options are:
- --delete : delete files that don't exist on sender (system) (Use with caution!!!)
- -v : Verbose (try -vv for more detailed information)
- -e "ssh options" : specify the ssh as remote shell
- -a : archive mode
- -r : recurse into directories
- -z : compress file data
- progress: will show the percentage of the file copied
Example commands:
Copy files from local server to remote server
$ rsync -v -e ssh /[local folder]/[local file] [remote.user]@[remote.server]:~
Copy files from remote server to local server
$ rsync -v -e ssh [remote.user]@[remote.server]:~/[remote.file] /[local.folder]
Synchronize directories from local server to remote server
$ rsync -r -a -v -e "ssh -l [remote.user]" [remote.server]:/[remote.directory]/ /[local]/[directory]
Synchronize directories from remote server to local server
$ rsync -r -a -v -e "ssh -l [remote.user]" [remote.server]:/[remote.directory] /[local]/[directory]
There other features such as excluding files while syncing and mirroring folders. Also, this process can be easier if password less authentication is set up between two servers. However, most of the basic use is covered above.
Site Backup… Lesson learned…
backup, backup, backup!!!...
Really important and even talked about it in my previous post... but never did act on it... until now... well... I am now using automatic backup plugin to back up my db and I feel lot better... ! Automatic backup does wonders for your mental health.
Took me 2 hours to bring it backup from its sorry state ... but lesson well learned... no I'll never go without backup !!!
Now if I can only do the same for all of my computers ...
etch sources list …
Well, it's already April, 2011 and since Feb 2010, the Debian Etch was no longer supported. Still, I have few machines running Etch and trying to install additional software proved impossible? Why, well source list is not correct!
First link from the Google search showed following page... and following his instruction I've added (and not ass) this below sources in to your sources.list file.
# vim /etc/apt/sources.list
# apt-get update
# apt-get install
Then my apt was happy again... for now... until we have to upgrade...