[Wolves] Cron question

chris procter chris-procter at talk21.com
Wed Jun 22 08:55:42 BST 2005


> Mmm, I left out of the original Q for simplicity,
> that I already DO move 
> the pictures out of the original directory before
> tarring.
> But this is maybe the problem, - MV'ing obv takes
> time, so whilst 
> moving, streamer is adding files to original, some
> of which get moved!
> and MV has a limit of 1024 files -which at 2 frames
> per sec is less than 
> 10 mins recording.
> So you end up with three cron jobs (move, tar,
> restart streamer) six 
> times an hour, which is a mess.
> My 'working' compromise has been to lower the frame
> rate to 1 every two 
> seconds, and cron every half hour, which loses lots
> of potential images.
> 
> Any ideas forward.

Dont mv the images out of the directory, mv the
directory itself
mv ~/images/current ~/images/old
mkdir ~/images/current

should be a lot faster (it only has to change one 
inode rather then the 1800+ for the files
individually). If its still not fast enough streamer
will try to write images to a non-existant directory
so depending on how it handles that you could try

DATE=`date "+%Y-%m-%d-%H"`
killall streamer
mv ~/images/current ~/images/temp
mkdir ~/images/current
streamer
tar xzf $DATE.tgz ~/images/temp/*
mv $DATE.tgz ~/images/archive/
rm -r ~/images/temp


i.e. kill the streamer process(es) move the directory
then recreate it, restart streamer so you start
getting the images again, then tar & gzip the old
images, archive the file created and remove the temp
directory and all its contents.

You may still lose a few seconds while streamer is
stopped but it should be fast enough that its only one
or two frames.

chris







	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com



More information about the Wolves mailing list