Near Realtime File Replication With Lsyncd

Ever wanted real time backups of  directories on your server? To replicate static media files for a website to a separate box to reduce load? An easy solution lays with lsyncd it allows you to watch a directory structure on your file system, and replicate any changes on a remote system. How It Works: inotify is a Linux subsystem available from the 2.6.13 release of the Linux kernel that monitors changes made to a file system and reports these changes to interested applications. lsyncd is an application written in lua that uses the inotify service to inform it of changes made to monitored directories and then when notified of a change uses rsync to replicate the changes on a remote service. Getting lsyncd The lsyncd sourcecode can be downloaded from Google Code and compiled but depending on the distribution your server is running, the install process be even easier as lsyncd is included in the repositories of many popular Linux distros. Installing On Debian / Ubuntu While lsyncd is included in both the repositories of Debian and Ubuntu but unfortunately its an outdated version so check what version you are going to get beforehand with the command: apt-cache show lsyncd If apt-cache tells you that only one of the 1.x versions are available, I would recommend grabbing one of the 2.x versions from the Debian testing repository instead, the amd64 package can be found here  and one for the i386 architecture here. Then install using the dpkg command i.e cd /root wget wget http://ftp.au.debian.org/debian/pool/main/l/lsyncd/lsyncd_2.0.4-1_amd64.deb apt-get install lua5.1 rsync dpkg -i lsyncd_2.0.4-1_amd64.deb […]

By |July 21st, 2011|Linux|2 Comments

Tracking Bandwidth Usage With vnStat

Outside of internal networks bandwidth is paid often for by the gigabyte and as such it becomes important to be able to see the bandwidth consumption of machines and plan future quotas accordingly as usage grows. There are plenty of packages available that fill this void like darkstat, ntop etc, but they tend to be overkill in a lot of situations were you don’t need pretty graphs you just want to know how much data is entering and leaving an interface.  Enter vnStat a simple console based tool that allows you to monitor traffic flow to and from interfaces on your servers. […]

By |July 5th, 2011|Linux|0 Comments