?
Solved

AIX 7.1 file conversion and print

Posted on 2014-10-10
4
Medium Priority
?
547 Views
Last Modified: 2014-10-11
We have some software running on AIX 7.1 and it outputs reports as text files to a temp folder. Each time a user requests a report, a new text file appears in the temp folder. We have no access to modify the way the program outputs the report.

We are wondering if there is a way for a script to sense a new file has been created, convert that file to a PDF and then move it to a shared folder for the users to view (they are all running windows workstations on a windows network). We need to copy the original text file to the shared drive as well.

I'm guessing ghostscript will be involved. Scripting is new to me, so I'm unsure how to sense the creation of a file, convert the file to PDF and then move the PDF and copy the text file all in one move.

Thanks for all help and suggestions!
0
Comment
Question by:kbdaemon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 1336 total points
ID: 40374070
Hi, I'm assuming you have a folder shared on you AIX machine that is accessible for your windows machines.

I would not try to 'sense' if there are new files, I would just create a script that gets triggered by cron, every 5 minutes (or every 1 minute) that moves the temp files to a 'convert' folder. Then convert all files in that 'convert' folder and move everything to the shared folder.

TMP_FOLDER=/path/to/temp
SHARED_FOLDER=/path/to/shared
CNV_FOLDER=/path/to/convert
mv ${TMP_FOLDER}/*.tmp ${CNV_FOLDER}/ 2>/dev/null
# convert command here (using enscript and ghostscript)
mv ${CNV_FOLDER}/* ${SHARED_FOLDER}/

Open in new window


Put the above in a script, make it executable and create the crontab entry:

* * * * * /home/user/script.sh

or:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/user/script.sh
0
 

Author Comment

by:kbdaemon
ID: 40374077
Well, I was going to ask the folder-sharing question later ;) and just create the folder for now, let files start hitting it since we are still using test data now anyway.

Will have to look up enscript.
0
 
LVL 20

Assisted Solution

by:carlmd
carlmd earned 664 total points
ID: 40374854
You should be aware that enscript creates a postscript file (suitable for printing), but not a pdf. You still need to convert the postscript file to a pdf.

Take a look at cifs for mounting the windows share on AIX.
0
 
LVL 38

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 1336 total points
ID: 40374943
Note that I was already suggesting to use enscript + ghostscript to get those PDF files (see code snippet above).
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month15 days, 15 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question