aboutsummaryrefslogtreecommitdiff
path: root/lp/stat/generic
blob: c1b1ba25149a7db6c9e586a8e9bf61faa62da560 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/local/plan9/bin/rc
if (! ~ $DEBUG '') flag x +

if (~ $THIS_HOST $DEST_HOST) {
	if (test -f $LPLIB/log/$LPDEST^.st) {
		echo status:
		tail -3 $LPLIB/log/$LPDEST^.st
	}
	cd $LPSPOOL
	if (test -d $LPDEST) {
		once=''
		for (i in `{lpsub sched $SCHED $LPDEST}) {
			if (~ $once '') {
				echo
				echo queue on $THIS_HOST:
				echo 'job		user	try	size'
				once=1
			}
			STATLINE=`{cat $LPDEST/$i^id}
			LSLINE=`{ls -l $LPDEST/$i}
			echo $STATLINE(1)^$STATLINE(3)'	'$STATLINE(2)'	'$STATLINE(4)'	'$LSLINE(6)
		}
	}
}
if not {
	{ echo -d$LPDEST -q; sleep 5 } | lpsend $DEST_HOST
}