1834015 Members
2780 Online
110063 Solutions
New Discussion

script

 
joe_biggs_1979
New Member

script

hi all,

I need to write a script which captures all the print jobs that are 3 days and older and send a notification to the concerned person.I
know lpstat -o output gives the print queue.I have not done much of scripting.So any help would be greatly appreciated.

thanks a bunch,
joe gibbs
5 REPLIES 5
Muthukumar_5
Honored Contributor

Re: script

can you give lpstat -o sample output to write script for you?
Easy to suggest when don't know about the problem!
Peter Godron
Honored Contributor

Re: script

Joe,
attached a script I quickly put together,
it SHOULD do the job (hopefully).
I have added comments, so you can see whats happening. If you want to see more please comment out the remove steps and look at the *.lis files.

If the script provides some help please also have a look at:
http://forums1.itrc.hp.com/service/forums/helptips.do?#34

Regards
Steve Steel
Honored Contributor

Re: script

Hi

Look at

www.shelldorado.com

Nice site

find /var/spool/lp/request -name cA* -type f -mtime +3 -follow|while read line
do
echo host" "$(cat $line|grep H|cut -c2-128)
echo user" "$(cat $line|grep P|cut -c2-128)
echo req." "$(cat $line|grep J|cut -c2-128)
echo file" "$(cat $line|grep T|cut -c2-128)
done


Will show all 3 day equests

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
TwoProc
Honored Contributor

Re: script

I posted a script that works for 7 days in the following forum thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=847518
We are the people our parents warned us about --Jimmy Buffett
Peter Godron
Honored Contributor

Re: script

Joe,
did these answers help?
If the problem is resolved,please read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#34 and close the thread, otherwise please update.
Thanks