This is just a quick tip for you out there that use DRBD in simple Primary/Secondary mode and need to check whether a script is executed on the node which is currently Primary and has the Drbd Filesystem mounted. Let's just say you need to copy stuff onto your Drbd partition via a cron script. You can use the following one liner which is checking on the device '''/dev/drbd0''' which you probably need to adept to your needs and will print a message to standard output if this is the node which is holding the resources. Just replace that message output with the command you would like to execute and you are good to go.

if [ "`mount | grep /dev/drbd0 | wc -l`" == "1" ]; then echo "We are holding the resources"; fi

Weekly folder of your new files

Sat, 14 May 2011 by Frank Lazzarini

Do you know the problem, you have a massive directory with tons of media data, and after work you want to watch the latest episode of your favorite show, and you jump into that directory knowing that there is a new episode, but that directory is cramped up with so …

read more

Crontab fun Decipher the following

Sat, 14 Nov 2009 by Frank Lazzarini

I've been croning a lot lately, and this is one cool combination of cron which I haven't thought was possible. In this example you see how powerful cron can be. Defying a lot specific rules in just one line of syntax. So let's come to it ... try to decipher the …

read more