[Xastir] Saving serial snapshots
Carl Makin
carl at stagecraft.cx
Wed Apr 15 22:04:56 EDT 2009
On Wed, 15 Apr 2009, Gerry Creager wrote:
> Personally, I think you ought to use the MD5 of the image as a seed for a
> RAND, and use that as the filename. A similar approach could be used for the
> extension.
Ahhh, a challenge. Well, a bit of one. <grin>
while [ 1 ]; do
kill -SIGUSR1 `cat ~/.xastir/xastir.pid`
if [ -f ~/.xastir/tmp/snapshot.png ]; then
md5sum ~/.xastir/tmp/snapshot.png > /tmp/gerrysseed
NEWFILENAME=`openssl rand -rand /tmp/gerrysseed -base64 30`
NEWEXT=`cat /proc/sys/kernel/random/uuid`
mv ~/.xastir/tmp/snapshot.png archive/$NEWFILENAME.$NEWEXT
rm /tmp/gerrysseed
fi
sleep 300
done
Um, the uuid thing only works on linux with /proc enabled.
Carl.
(vk1kcm)
It's obviously a slow day at work today...
More information about the Xastir
mailing list