- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Shell Script to kill print request
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2008 10:02 PM
03-05-2008 10:02 PM
Shell Script to kill print request
find /var/spool/lp/request/$PRINTER -mtime +0
Need some advise. THanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2008 03:23 AM
03-06-2008 03:23 AM
Re: Shell Script to kill print request
do
rm -rf $i
done
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2008 05:32 PM
03-06-2008 05:32 PM
Re: Shell Script to kill print request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2008 06:18 PM
03-06-2008 06:18 PM
Re: Shell Script to kill print request
Sorry n00b here..:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2008 06:59 PM
03-06-2008 06:59 PM
Re: Shell Script to kill print request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2008 10:59 PM
03-06-2008 10:59 PM
Re: Shell Script to kill print request
Thanks. Lets just say that i do not have root capability...is there any way to do this.
I would like to know if there is a way to 'get' the print request id and parse it in the script...allowing a cancel.
like:
cancel $PRTID
Appreciate the inputs so far.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2008 12:05 AM
03-07-2008 12:05 AM
Re: Shell Script to kill print request
PRINTER=XXX
for lp in $(find /var/spool/lp/request/$PRINTER -mtime +1 -name "cA*") ; do
# get base, strip off leading "cA", then strip off hostname
base=${lp##*/}
lp_id=${base#cA}
lp_id=${lp_id%$(hostname)}
echo cancel $PRINTER-$lp_id
done
Remove "echo" when happy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2008 05:08 AM
03-07-2008 05:08 AM
Re: Shell Script to kill print request
#!/usr/bin/sh
#
#
#
trap '' INT
function cont
{
print -n "Do You Wish to Continue Y/N : "
read answ
if [[ $answ = [Yy] ]]
then
return 0
else
return 1
fi
}
while true
do
clear
print -n "
* HELP DESK MENU *
$(uname -n)
HELLO: $(whoami)
===================================================
1. Run Restricted SAM to reset passwords.
2. Display printer status / print jobs.
3. Cancel a print job.
4. Cancel ALL print jobs for a printer.
5. EXIT this program and RETURN TO COMMAND LINE.
===================================================
Select an Option # from above: "
read answer
case "$answer" in
5*|Qq|bye|Ee ) print "Quitting! See You Later, $(whoami)" ; exit ;;
1) if cont
then
. /usr/sbin/sam
fi;;
2) if (( $? == 0 ))
then
print -n "Enter Printer Name: "
read prtr
lpstat $prtr
print -n "OK to clear screen [Hit Any Key]"
read h
fi;;
3) if (( $? == 0 ))
then
print -n "Enter Printer Name-job#: "
read prtr
cancel $prtr
fi;;
4) if (( $? == 0 ))
then
print -n "..Enter printer name :"
read prtr_name
print -n "You enter printer ${prtr_name}"
print -n " Is this correct Y/N "
read answ
if [[ "$answ" = [Yy] ]]
then
lpstat $prtr_name | grep $prtr_name | sort -k1 | cut -d " " -f1 > $prtr_name.out
for rem_prt in `cat $prtr_name.out`
do
cancel $rem_prt
done
else
echo "No Such Printer"
fi
fi;;
esac
done
Number 3 and 4 may assist you..
Rgrds,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2008 07:44 AM
03-07-2008 07:44 AM