2010
01.21

nerditry

I wrote a script that does the following on a unix clone,  in this case this webserver heh:

  • runs in manual or non-manual (eg cron) mode, configurable in a variable.
  • pulls the content of a (configurable) directory into a tar archive, compresses it on the fly with gzip and stores it in another (configurable) directory.
  • detects if the run is the first one (eg backup is mandatory) otherwise it checks to see if the configured directory that should be backed up has changed size. If it has, the script will backup the dir, otherwise it won’t.
  • detects the size of the backup, and will write a warning if the size of the target dir is less than twice the size of the backup, and will write an error and fail if the size of the target dir is equal or less than the estimated size of the backup.
  • has a a lock file scheme, eg prevents the script starting while another instance of it is running
  • has an email scheme, ie you get a “backup was successful || failed miserably” email to a mailbox you configure in the script.

to do:

-do something snazzy when run in manual mode to show the user that the script is actually still running hehe
-implement passwordless scp copy to a configured remote machine…..maybe :)

only took me about an hour and a half to write, which I felt pretty good about considering the last time I wrote something is nearly a year ago. good to see I still have it in me heh :)

ps. nurd! :)

2009
12.21

more snow lunacy! err, well, me being sensible (or so I thought). anyway, I have to be off very early tomorrow (bah), and all the way to merry Rotterdam too (double bah), so to save myself extra work during dawn’s early light (triple bah) aka maximizing time in bed (yay) I thought I would go down to where my trusty carriage is parked to see if all was well and to dig it out of any mountains of snow that it may be buried in.

so, to conform to the internet age, where typing boobies! is not as good as displaying a picture of said boobies! (at least, I think so), I bring you my efforts in pictures (and please excuse the quality heh):

coming to ye olde polo here. strange how the pics completely do away with any depth perception. some of the snow I walked through to get to the car was over 30cm deep!

car

car

Read More >>