Warning: The magic method SFML_Singleton::__wakeup() must have public visibility in /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php on line 72

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-content/plugins/uncode-privacy/includes/class-uncode-toolkit-privacy-public.php on line 355

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/selectec/public_html/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/selectec/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":4472,"date":"2018-03-20T12:21:36","date_gmt":"2018-03-20T12:21:36","guid":{"rendered":"http:\/\/staging.selectec.com\/?p=4472"},"modified":"2018-09-10T16:43:27","modified_gmt":"2018-09-10T16:43:27","slug":"custom-timeout-value-papercut","status":"publish","type":"post","link":"https:\/\/selectec.com\/custom-timeout-value-papercut\/","title":{"rendered":"Custom Timeout Value For PaperCut"},"content":{"rendered":"

Creating a custom timeout value for PaperCut<\/h2>\n

We received a phone call this morning from a long-term reseller, they were onsite updating PaperCut MF to v18 and the customer had asked for some advanced configuration to happen after the upgrade. The customer wanted to have greater control over when held print jobs are deleted if they are not released, so we started to look for ways to create a custom timeout value for PaperCut.<\/p>\n

What does that do? Good question…<\/p>\n

When print jobs are sent to a secure print queue they are paused until released, after X amount of time they are deleted by PaperCut. PaperCut deletes the jobs for two reasons.<\/p>\n

    \n
  1. If you have not released the job in a day or so did you really need it? Probably not, this saves paper.<\/li>\n
  2. If older jobs were not flushed from the print queue every so often you may find the strain on the server is too much. Some versions of Windows get upset when there are 1000\u2019s of jobs sitting in a single queue ready for release.<\/li>\n<\/ol>\n

    The timeout value will be different between organisations, as every environment is different and each customer has their own needs. The default values upon installation of PaperCut are different depending what option you selected during setup, education is set to two hours and commercial defaults to four hours.<\/p>\n

    The timeout is configurable at a global level (impacts all print queues), you can change it as you see fit via the PaperCut Admin UI by going to:<\/p>\n

    Options \u2192 General \u2192 Hold\/Release Queues \u2192 Delete held jobs if not released after.<\/em><\/p>\n

    \"custom<\/p>\n

    Newer installs of PaperCut have the option to set the timeout per print queue (overriding the global value) by importing one of the easy to use print script<\/a> recipes and editing the timeout variable in the script as you see fit.<\/p>\n

    \"custom<\/p>\n

    Given that there is a print script option to set the hold\/release timeout<\/p>\n

    actions.job.setHoldReleaseTimeout()<\/pre>\n

    we have greater freedom over the timeout value. Back to the customer\u2026<\/p>\n

    They currently have a timeout value of twelve hours, this suits them for the majority of printing they perform. As their print facilities are open seven days a week they needed some special rules put in. They wanted users printing last thing on a Friday able to pick up their documents the following week, the same for Saturday and Sunday, if they sent a print on the weekend it needed to be available Monday. The current twelve hour\u00a0timeout value would delete any of these jobs before users had a chance to get at them on Monday. The way around this is to be able to set a custom timeout based on the day (and even the time of day). The thinking behind the script is to keep jobs for 4 days for any print jobs sent on a Friday, 3 days for Saturday, 2 for Sunday and so on.<\/p>\n

    The script assumes that Sunday is day 0 (the start of the week) and Saturday day 6 (the end of the week). To help administrators, any jobs sent also have a comment logged against them that explains they had an extended timeout.<\/p>\n

    The script performs these actions from 6pm on Friday until 8am Monday morning.<\/p>\n

    Feel free to give the script a go, the important bits to edit are:<\/p>\n

    actions.job.setHoldReleaseTimeout (2 * _dayMinutes) ;<\/pre>\n

    – The dayMinutes value is 1440 (number of minutes in a day). in this example, we keep the job for 2 x 1440 minutes.<\/p>\n

    actions.job.addComment(\"Job timeout set to 2 days\");<\/pre>\n

    – This is the optional job comment, feel free to remove this line if it is not required.<\/p>\n

    To adjust the time, look for if \u201c(_hour < 8\u201d or \u201cif (_hour > 18\u201d, this is very simple and means < before or after > certain times. You can remove these if you need it to apply all day.<\/p>\n

    The Script<\/h2>\n
    \/*\r\n\/*\r\n \t \t* Revised hold\/release time for job sent out of hours.\r\n \t \t* 6pm Friday - 8 am Monday - extend by X hours.\r\n \t \t*\/\r\n \t \tfunction printJobHook(inputs, actions) {\r\n \t \t if (!inputs.job.isAnalysisComplete) { return; } \r\n \t \t var _today = inputs.job.date.getDay();\r\n \t \t var _hour = inputs.job.date.getHours();\r\n \t \t var _dayMinutes = 1440; \t \r\n \t \t \r\n \t \t switch (_today) {\r\n \t \t \/\/ Sunday\r\n \t \t case 0:\r\n \t \t actions.job.setHoldReleaseTimeout(2 * _dayMinutes);\r\n \t \t actions.job.addComment(\"Job timeout set to 2 days\");\r\n \t \t break;\r\n \t \t \/\/ Monday\r\n \t \t case 1:\r\n \t \t if (_hour < 8) { actions.job.setHoldReleaseTimeout(1 * _dayMinutes); actions.job.addComment(\"Job timeout set to 1 day\"); } break; \/\/ Friday case 5: if (_hour > 18) {\r\n \t \t actions.job.setHoldReleaseTimeout(4 * _dayMinutes);\r\n \t \t actions.job.addComment(\"Job timeout set to 4 days\");\r\n \t \t } \r\n \t \t break;\r\n \t \t \/\/ Saturday\r\n \t \t case 6:\r\n \t \t actions.job.setHoldReleaseTimeout(3 * _dayMinutes);\r\n \t \t actions.job.addComment(\"Job timeout set to 3 days\");\r\n \t \t break;\r\n \t \t }\r\n \t \t \r\n \t \t}\r\n<\/pre>\n

    Anything else?<\/h2>\n

    When picking a timeout value it is well worth considering the following:<\/p>\n