CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 31 Jul 2025 16:02:05 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090210090621
location: https://web.archive.org/web/20090210090621/https://examples.oreilly.com/upt2/split/watchq
server-timing: captures_list;dur=0.774039, exclusion.robots;dur=0.032073, exclusion.robots.policy;dur=0.016144, esindex;dur=0.016045, cdx.remote;dur=31.944348, LoadShardBlock;dur=441.732435, PetaboxLoader3.datanode;dur=121.398373, PetaboxLoader3.resolve;dur=208.979117
x-app-server: wwwb-app211
x-ts: 302
x-tr: 520
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app211; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Thu, 31 Jul 2025 16:02:08 GMT
content-type: text/plain
content-length: 1041
x-archive-orig-date: Tue, 10 Feb 2009 09:06:20 GMT
x-archive-orig-server: Apache
x-archive-orig-last-modified: Mon, 31 Mar 2008 18:10:12 GMT
x-archive-orig-etag: "436932-411-90194900"
x-archive-orig-accept-ranges: bytes
x-archive-orig-content-length: 1041
x-archive-orig-connection: close
cache-control: max-age=1800
x-archive-guessed-content-type: text/plain
x-archive-guessed-charset: utf-8
memento-datetime: Tue, 10 Feb 2009 09:06:21 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Wed, 19 Jun 2002 02:05:48 GMT", ; rel="prev memento"; datetime="Sun, 18 May 2008 20:48:41 GMT", ; rel="memento"; datetime="Tue, 10 Feb 2009 09:06:21 GMT", ; rel="next memento"; datetime="Wed, 30 Sep 2015 16:39:14 GMT", ; rel="last memento"; datetime="Fri, 25 Mar 2016 02:59:09 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_8_20090210075601_crawl103-c/52_8_20090210090608_crawl100.arc.gz
server-timing: captures_list;dur=3.351865, exclusion.robots;dur=0.020096, exclusion.robots.policy;dur=0.009000, esindex;dur=0.011111, cdx.remote;dur=56.497307, LoadShardBlock;dur=1032.053677, PetaboxLoader3.resolve;dur=1443.137787, PetaboxLoader3.datanode;dur=292.913670, load_resource;dur=851.634668
x-app-server: wwwb-app211
x-ts: 200
x-tr: 1975
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
accept-ranges: bytes
#!/bin/sh
#
# watchq - "daemon" script that watches printer queue(s) for errors
# Change these next variables to suit your situation
watch=/usr/local/lib/watchqs # File that holds names of the queues to watch
writeto=lisa # User who gets notices about printer
temp=/tmp/WATCHQ$$ # Temporary file that holds the output of lpq
queues="`cat $watch`" # Put list of queue names in $queues
trap 'queues="`cat $watch`"' 1 # Reset $queues if we get a SIGHUP
trap 'rm -f $temp; exit' 0 15 # Clean up temp file when killed
# Loop forever (until someone kills script):
while :
do
# for each queue
for queue in $queues
do
# Query the printer
lpq -P$queue >$temp
# Look for errors
if egrep '(out of paper|error|warning)' $temp > /dev/null
# If there were errors, let someone know about them
then echo "PRINTER QUEUE $queue:" | cat - $temp | write $writeto
fi
done
# Sleep 30 seconds in between checking printers
sleep 30
done