[mythtv-users] Anyone using in crontab?

Robin Hill myth at robinhill.me.uk
Wed Dec 12 17:08:34 UTC 2007


On Wed Dec 12, 2007 at 04:37:37PM +0000, nospam312 wrote:

> However when I add the script to my crontab the script fails when it
> calls the system("mplayer","-noframedrop","-ss",$SKIP,"-vo","jpeg:quality=50:outdir=$OUTPATH","-frames","2", at VC,"-nosound",$FILE);
> line as the 00000002.jpg file is not generated and therefore the mv
> command fails.
> 
> What is strange is the previous calls to mplayer via the line "my
> $length=`echo -n q | mplayer -vo null -nosound -identify -vc null
> "$FILE" | egrep "^(ID_LENGTH=)" | cut -d '=' -f 2`;" works fine as
> $length is assigned the correct value.
> 
> This seems to point to the script is able to read the file and
> permissions are set correctly.  Does anyone have any idea why the
> system("mplayer"...) line is failing?
> 
I'm pretty sure this is a path problem - in the first example you're
using the system command so it'll inherit the path from the calling
process (the perl script, which in turn inherits it from cron, which
usually has a minimal path), and in the second example you're using
backticks which will spawn a new shell process, picking up the usual
profile & bashrc settings.  Try specifying the full path to mplayer in
the system command.

HTH,
        Robin
-- 
     ___        
    ( ' }     |       Robin Hill        <myth at robinhill.me.uk>  |
   / / )      | Little Jim says ....                            |
  // !!       |      "He fallen in de water !!"                 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20071212/613fed97/attachment.pgp 


More information about the mythtv-users mailing list