Superb quality and spec AB-Com PULSe 4K SE. Crazy offer! Only £129! FREE UK DELIVERY! 4K UHD, Enigma 2, Multiboot 4 images & more!...
Superb quality and spec AB-Com PULSe 4K Rev II Twin Satellite tuner only £179! FREE UK DELIVERY! 4K UHD, Enigma 2, SATA HDD facility, Multiboot 4 images & more!...

[ViX_Misc] How to detect if actively recording?

trevsat

New member
Joined
Jul 10, 2016
Messages
19
Reaction score
0
Points
1
Stuck on old release, it's the latest stable version for GigaBlue QuadPlus, later versions get sick after hours or days resulting in PAT tuner timeouts.

So that's an aside.

Q: What I'd like to know is, from a shell script run by cron, how can I tell if a recording is currently active? poking around in /proc/ didn't turn up much.

I want to do intrusive actions like reboot etc. but delay/wait until no recordings are happening.

thanks
 
The information about any running recording is contained within the enigma2 image, so you'll need to query it.

A bit of a hack, but:
Code:
wget -qO - http://127.0.0.1/ajax/timers | grep -E '^[[:space:]]*running[[:space:]]*$'
will produce output if there is a running timer.
 
But even if no recording is in progress, one could start any second. So maybe it would be safer to extract the timers?
 
Building on the earlier suggestion, here's a bit of Python tested on OpenVix 4.1.013 which will look at all your timers and tell you if you are inside a timer window or 5 mins before a timer is due to start.

At the top you can change the self.recordWindow=300 to create a bigger window (in seconds) if you want one. As far as embedding into a shell script just call it and check for the exit code not being 1, something like:

./isrecording.py
if [ $? = 0 ]
then
echo good to go, nothing recording or due to start
fi

as long as the xml returned doesn't change you will be ok, I've include a debug line you can turn on in case it does, maybe turn it on and see what good output looks like so you can check later.

Hope that helps
 

Attachments

Jumped the gun, you need this test as well

if _now>=_start and _now<_end:
_hit=True

New version attached
 

Attachments

Last edited:

OpenViX Feeds Status

Back
Top