How to hold & release print jobs using cups?

0

I have installed CUPS 1.6.3 on centos 7. I am trying to find a solution to hold printing jobs from 6pm Friday to 6am Monday but I'm not sure how to do it.

I found few commands but I'm not sure how to use them as there is no example. Commands I'm looking after are: Hold-New-Jobs & Release-Held-New-Jobs from page https://www.cups.org/doc/spec-ipp.html#IPP_OPERATIONS.

I want to run a cron with command to Hold-New-Jobs at 6PM Friday and then another cron to Release-Held-New-Jobs on Monday 6am.

I have a printer named Printer2. Can you please help me with above?

UPDATE

Below cron job did the trick.

# hold print jobs on Printer2 at 6pm Friday.
0 18 * * 5 /usr/sbin/cupsdisable --hold Printer2 >/dev/null 2>&1

# release print jobs from Printer2 at 6am Monday
0 06 * * 1 /usr/sbin/cupsenable --release Printer2 >/dev/null 2>&1

Damodar Bashyal

Posted 2019-02-19T22:47:02.330

Reputation: 103

Answers

1

Run a cron job to disable the queue at 6pm on Friday (cupsdisable <queue>). Then run another cron job to re-enable the queue at 6am on Monday (cupsenable <queue>).

Queues disabled with cupsdisable will accept new jobs, but won't process them.

Bryan Mason

Posted 2019-02-19T22:47:02.330

Reputation: 26

Thank you. Used that command and it worked. See updated question for the syntax used. – Damodar Bashyal – 2019-02-28T22:15:25.483