[Gllug] inotify - simple angband cheat script

Walter Stanish walter.stanish at saffrondigital.com
Fri Oct 15 22:41:16 UTC 2010


Not sure if everyone's familiar with inotify - a Linux feature for
monitoring parts of a filesystem for changes.

As an example, the following perl (could be bash but I always forget the
control structure syntax, due to infrequent use) script is something I
hacked together to get the hang of inotify-tools, which are a command-line
interface to Linux's inotify features.

Each type a 'create' event occurs within the ~/.angband/Angband filesystem,
a complete copy of that directory is made to a date and timestamped backup
directory.

This would (I suppose) let you resurrect dead angband* characters :)

Trivial but potentially worth sharing!

===================
while(1) {
 `inotifywait -e create -r ~/.angband/ 1>/dev/null 2>/dev/null`;
 `cp -R ~/.angband/Angband/ ~/.angband/\`date '+%Y-%m-%d.%H:%M:%S'\``;
}
===================

* See http://en.wikipedia.org/wiki/Angband_(video_game)

- Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20101015/f4031b0d/attachment.html>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list