Casey Bralla on 24 Aug 2008 14:09:59 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] Why does it produce a silent error when run from crontab?


I've got a small batch program that creates a nifty near-realtime view of the 
earth with animated cloud cover (http://www.nerdworld.org/nerdspace.html) 
that **used** to work, but now doesn't on my Debian 4 server.

I can run the program just fine from a command prompt, but it fails in a very 
strange way when run from crontab.

The program has to do some image manipulations, and to do so it 
calls "jpegtopnm" (part of "netpbm") to convert some jpg files into pnm 
format.

Oddly, I can run the conversion script from a bash shell prompt without any 
trouble, but the program bombs weirdly if run from crontab.   When it bombs, 
it doesn't halt or give any kind of error message;  but jpegtopnm just 
creates a pnm file of zero length.


So, to summarize:

When jpegtopbm runs in a script started from command prompt, it runs fine.  
But when it runs in the same script started by crontab, it bombs silently 
without creating the pnm image file.





Here's an abbreviated version of the script file:

#!/bin/bash

# Create globe images with xplanet.  Create xplanet00.jpg
/usr/bin/xplanet -body earth -num_times 1 -verbosity 1 -config 
xplanet00.cfg -latitude 39.81 -longitude -75.90 -geometry 1003x752 -starfreq 
0 -projection orthographic -output xplanet00.jpg

# Convert to intermediate format "pnm"
/usr/bin/jpegtopnm -verbose xplanet00.jpg > xplanet00.pnm
# (This is the line that does not work in batch mode)






The crontab line looks very normal:
0,15,30,45 * * * *       root   /path/create.xplanet.images





Anybody have any suggestions of where to explore troubleshooting this problem?

All my error logs are clean.  Nothing looks amiss, except that it doesn't 
work.  <sigh>


-- 


Casey Bralla
Chief Nerd in Residence
The NerdWorld Organisation
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug