Hylafax Mailing List Archives

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

Re: [hylafax-users] help needed in faxrcvd script



Sam Kalet wrote:
Pine.GSO.4.21.0308060933360.17980-100000@woodchuck.conectiv.com">
Proposed Solution:

FILENAME=`echo $FILE | sed -e 's/\.tif//'`
/usr/bin/tiff2ps -a $FILE | lpr -P BrotherFax -o natural-scaling=95 -o
media=letter
/usr/bin/tiff2ps -a -O $SPOOL/$FILENAME.ps $SPOOL/$FILE
/usr/bin/ps2pdf $SPOOL/$FILENAME.ps $SPOOL/$FILENAME.pdf

This looks good. I would then add:

FN2=`date +%Y%m%d-%T`
Ahh, but that's not quite the same as the time the file was created...
Pine.GSO.4.21.0308060933360.17980-100000@woodchuck.conectiv.com">

mv $SPOOL/$FILENAME.pdf /home/public/FAX/$FN2.pdf

This will yield a filename of 20030806-09:33:07.pdf for a file created now.
The syntax of the format string to the date command is for Solaris - it might
differ on your platform.

Is this what you are looking for? I would be concerned about two files being
created during the same second (with the same name). I suggest you preserve
the original queue name in the filename somewhere since they are guaranteed to
be unique. So:

mv $SPOOL/$FILENAME.pdf /home/public/FAX/$FN2-$FILENAME.pdf

which yields a filename like 20030806-09:33:07-fax00009.pdf. This also lets
you correlate the fax with the logs easier, in case you need to debug a problem
reported later.


____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null
*To learn about commercial HylaFAX(tm) support, mail sales@hylafax.org.*






Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services