Lyle Chapman wrote:

> I have a small script that monitors a particular folder and then 
> forwards files for printing, can anybody show me how to suppress error 
> messages and only display certain messages like "Looking for files to 
> print" and "Files found! Preparing to print" or something along those 
> lines and make it loop forever?
> 
> #!/bin/sh
> #Looping .pdf script
> 
> do
> echo looking for file to print
> lp -d brothers /home/user/workflow/Proofers/A4/*.pdf
> lp -d xeroxq /home/user/workflow/Proofers/A3/*.pdf
> rm /home/user/workflow/Proofers/A4/*.pdf
> rm /home/user/workflow/Proofers/A3/*.pdf
> sleep 15
> done

If the script loops you have to use Ctrl-C to kill it. Instead run it 
from a cron job set to every 15 minutes or so.


#!/bin/sh
# Describe here is a few lines exactly what the script does
# Author: Lyle Chapman, Pre-Press Supervisor
# This version: 6th Dec 2003

# TODO - write a log of what has been printed and when.

Source_A$ = "/home/user/workflow/Proofers/A4"
Backup_A4 = "/home/user/workflow/Backup_A4"

echo "looking for A4 files to print"
for files in $Source_A4/*.pdf ; do
        lp -d brothers $file
# TODO test the return status of the lp job and move it to the backup
# directory. Clear out the backup directory every few days if the return
# status was OK and no one complained that the printer stufffed up.
        mv $file $Backup_A4
done

echo "looking for A3 files to print"
for files in $Source_A3/*.pdf ; do
        lp -d xeroxq $file
        mv $file $Backup_A3
done



-- 
Michael Lake
Chemistry, Materials & Forensic Science, UTS
Ph: 9514 1724 Fx: 9514 1460



UTS CRICOS Provider Code:  00099F

DISCLAIMER
========================================================================
This email message and any accompanying attachments may contain
confidential information.  If you are not the intended recipient, do not
read, use, disseminate, distribute or copy this message or attachments.
If you have received this message in error, please notify the sender
immediately and delete this message. Any views expressed in this message
are those of the individual sender, except where the sender expressly,
and with authority, states them to be the views the University of
Technology Sydney. Before opening any attachments, please check them for
viruses and defects.
========================================================================

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to