bash Postscript delegate failed in crontab

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
libarth
Posts: 3
Joined: 2013-09-05T06:49:53-07:00
Authentication code: 6789

bash Postscript delegate failed in crontab

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bash Postscript delegate failed in crontab

Post 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.
libarth
Posts: 3
Joined: 2013-09-05T06:49:53-07:00
Authentication code: 6789

Re: bash Postscript delegate failed in crontab

Post by libarth »

Hi,

I have already check this, all paths are full.

Regards,
Lionel
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: bash Postscript delegate failed in crontab

Post by glennrp »

What's the full path for "gs"?
libarth
Posts: 3
Joined: 2013-09-05T06:49:53-07:00
Authentication code: 6789

Re: bash Postscript delegate failed in crontab

Post by libarth »

Hi,

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

Lionel
Post Reply