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 28 29 30 31 32 33 34 35 36 37 38 39
|
#!/usr/local/bin/bash
#
# use: testpr [last job number [first job number]]
# testpr script
#
# Throughput and lost file test script
#
# Set up a print queue with:
# lp:sd=/tmp/lpd/%P
# :filter=/tmp/testfilter
# :lp=/dev/null
#
# /tmp/testfilter:
# #!/bin/sh
# # The filter will create files in /tmp/files with the name
# # corresponding to the first word in file
# if [ ! -d /tmp/files ] ; then mkdir /tmp/files ; fi
# read var
# var=`echo $var | sed -e 's,.*/,,'`
# date >/tmp/files/$var
#
# now do:
#
# chmod a+x /tmp/testfilter
# run checkpc
#
# Send jobs using:
# bash testpr (10 jobs)
# bash testpr 100 (100 jobs)
# bash testpr 200 100 (100, starting at id 100 jobs)
P=-Pp
set -x
lprm $P all
d=/tmp/files
if [ ! -d $d ] ; then mkdir -p $d; fi
chmod 777 $d;
(cd $d; rm -f *;)
for((i=${2:-0}; i < ${1:-10}; ++i)) ; do echo $i |lpr $P ; done;
|