Package: flashcache-utils
Version: 1.0+git20130518-1
Severity: wishlist

Dear Maintainer,

I had the problem of my daily backups wiping my cache everyday, since the
backup just goes over the whole disk. Similar, even if less than a problem,
the various standard crob jobs doing recursive "find" all over the place.
I wanted to blacklist such processes from the cached device, and (for some
cases) I came up with a wrapper script which does exactly that:
1) it runs whatever is given to it as an argument
2) blacklists its process
3) waits till it's finished
4) removes the process from the blacklist
5) return the exit code of the process that was run

So, for simple processes (which do not spawn themselves other processes) it
just transparently causes the process to avoid destroying the cache.

Of course, one could reverse the logic and add the pid to the whitelist
instead, that's trivial.

If you think it may be useful, you may include this script (or something
better along these lines) in /usr/share/doc/flashcache-utils/ in some 
forthcoming release. The script follows:

#! /bin/bash
CACHEDEVICES="/dev/mapper/mycachedev1 /dev/mapper/mycachedev2"

$* & 

mypid=$!

for dev in ${CACHEDEVICES} ; do flashcache_setioctl -a -b ${mypid} ${dev} ; done
wait ${mypid}
exitcode=$?
for dev in ${CACHEDEVICES} ; do flashcache_setioctl -r -b ${mypid} ${dev} ; done

exit ${exitcode}


Best regards, bye
Giacomo


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to