Print Queue command line commands

I am looking to make my print queues to turn on and turn off during certain times of the day. For example: I would like to turn the printing feature off from 8am until 10:45am and then turn it on from 10:45 until 12:45pm then turn off until 2:30pm and stay on until 8am the next morning. I have been looking through some of the command line commands and found the following information in the command line pdf at Apple's documentation center.

Listing Queues
You can use the serveradmin getQueues command to list Print service queues.
$ sudo serveradmin command print:command = getQueues

Pausing a Queue
You can use the serveradmin setQueueState command to pause or release a queue.
To pause a queue:
$ sudo serveradmin command
print:command = setQueueState
print:state = PAUSED
print:namesArray: arrayindex:0 = queue
Control-D

I also found the serveradmin setQueueState command but there is no documentation on it. I have searched all over Apple's website, I have asked several SEs, and I have also googled it with no luck.

Can anyone help me with tracking down more information on this command and how to make it a cronjob (or whatever 10.4 Server has now)?

Thanks,
Jason F

PowerBook G4 17' 1.33 Mac OS X (10.4.5)

PowerBook G4 17' 1.33 Mac OS X (10.4.5)

Posted on Mar 15, 2006 10:56 AM

Reply
4 replies

Mar 20, 2006 8:13 AM in response to Jason F

ok so you got it in your first message :

create a new text file with this code
ie name of file = paused.sh

#
sudo serveradmin command
print:command = setQueueState
print:state = PAUSED
print:namesArray:arrayindex:0 = queue
exit
#eof


where queue is the name of your queue obtained with
$ sudo serveradmin command print:command = getQueues

then
$ chmod -x paused.sh

and run this shell script in as cron job (you can use cronX : http://www.abstracture.de/projects-en/cronnix )

it should work…

tell us

Mar 20, 2006 8:38 AM in response to Jason F

I also found the serveradmin setQueueState command but there is no documentation on it.


Sorry, before anything
try this in terminal on the server :

$ sudo serveradmin command [press enter]
print:command = setQueueState [press enter]
print:state = PAUSED [press enter]
print:namesArray:arrayindex:0 = NameOfPrinterQueue [press enter]
exit


then check your printer queue status status should be "PAUSED"

$ sudo serveradmin command print:command = getQueues

to realease :

$ sudo serveradmin command [press enter]
print:command = setQueueState [press enter]
print:state = RESUMED [press enter]
print:namesArray:arrayindex:0 = NameOfPrinterQueue [press enter]
exit


then check your printer queue status status should be ""

$ sudo serveradmin command print:command = getQueues

Regards

Xserve G4, Cluster Node G4

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Print Queue command line commands

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.