Page 1 of 1

bash Postscript delegate failed in crontab

Posted: 2013-09-05T07:09:58-07:00
by libarth
Hi,

I have writen a bash script that converts files from pdf to jpg using : convert -verbose -density 400 $pdf $jpg

The bash script works perfectly when I launch it from the command line but not when I launch it from a crontab.
The bash script works if I run it from the command line as root.
I tried to add a sudo -u lbarth before the convert command without results.
I tried to add a sudo -u lbarth before the bash script in the crontab without results.

Here is the error output I get :
"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pam" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r400x400" -dUseCIEColor "-sOutputFile=/var/tmp/magick-78977DIiK_T24urq1%d" "-f/var/tmp/magick-789778Curql3jynzC" "-f/var/tmp/magick-78977iNYmPf2wliA7"
convert: Postscript delegate failed `/Users/lbarth/.../9782012457430-IN03.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/682.
convert: no images defined `/Users/lbarth/.../9782012457430-IN03.jpg' @ error/convert.c/ConvertImageCommand/3127.

The file 9782012457430-IN03.pdf exists. I thought the problem is a write permission on /var/tmp so I tried to redefine TMPDIR as mentionned in http://ghostscript.com/doc/7.07/Use.htm#Temp_files but it didn't work, ghostscript still try to write to /var/tmp.

I work on on macosx 10.8.4 with ImageMagick-6.8.6-9 and ghostscript-9.10.

What can I do ?

Regards,
Lionel

Re: bash Postscript delegate failed in crontab

Posted: 2013-09-05T18:28:28-07:00
by fmw42
I have not used crontab before.

Bu, it may be an issue of not finding the right paths to your files or to IM from crontab. Try using full paths to convert and to your images rather than any relative paths.

Re: bash Postscript delegate failed in crontab

Posted: 2013-09-06T01:15:26-07:00
by libarth
Hi,

I have already check this, all paths are full.

Regards,
Lionel

Re: bash Postscript delegate failed in crontab

Posted: 2013-09-06T08:45:31-07:00
by glennrp
What's the full path for "gs"?

Re: bash Postscript delegate failed in crontab

Posted: 2013-09-10T06:47:07-07:00
by libarth
Hi,

I do not call gs directly, I call convert with its full path.

Lionel