Printing documents on lxplus

The following may come in handy for Debian, Arch, etc. users for whom installing CERN printers locally is a pain.

Note that CERN's mail2print service is another good option, however it is only able to print to a subset of CERN's public printers.

1: Copy documents to lxplus

From the computer where the document lives:

scp </path/to/document> <NICE_username>@lxplus.cern.ch:~

This will copy the local file to your lxplus home directory.

<NICE_username> is your standard CERN login.

For example

scp ~/example_document.pdf cernuser@lxplusNOSPAMPLEASE.cern.ch:~

2: List available printers

ssh to lxplus and then run

lpstat -a

This command will dump a list of every public printer at CERN of which there are a lot.

lpstat -a

1-1017-CANC3 accepting requests since ven. 16 oct. 2020 09:51:50 CEST
1-1017-HPC accepting requests since ven. 16 oct. 2020 09:55:59 CEST
1-1041-HPCOL accepting requests since ven. 16 oct. 2020 09:56:44 CEST
1-1049-HP accepting requests since ven. 16 oct. 2020 09:55:59 CEST
1-R019-HP accepting requests since ven. 16 oct. 2020 09:55:58 CEST
1-R034-HPCOLOR accepting requests since ven. 16 oct. 2020 09:55:58 CEST
1-R035-HPCOL accepting requests since ven. 16 oct. 2020 09:55:57 CEST
1-R040-HPBW accepting requests since ven. 16 oct. 2020 09:55:57 CEST
10-1003-CANC3 accepting requests since ven. 16 oct. 2020 09:54:28 CEST
10-1012-CANC3 accepting requests since ven. 16 oct. 2020 09:52:32 CEST
etc...

The first space separated field (bolded here) is the printer name.

It is convenient to get only printers in your building. The following command should do that (if you're in a bash shell at least):

for printer in $(lpstat -a | awk '{print $1}'); do if [ "$(echo ${printer} | awk -F\- '{print $1}')" == "<building_number>" ]; then echo ${printer}; fi; done

For example to see all printers in building 40:

for printer in $(lpstat -a | awk '{print $1}'); do if [ "$(echo ${printer} | awk -F\- '{print $1}')" == "40" ]; then echo ${printer}; fi; done
40-1A214-CAN1
40-1B-HPBWCOR
40-1C-20
40-1D-CORHP
40-2B-HPCOR
40-2B28-HPCOL
40-2DCOR-CAN1
40-3B-HPCOR
40-3C02-HP
40-3C08-HPB
40-3D-HPCOR
40-4B-HPCOR
40-4C12-HP
40-4D-HPCOR
40-4D-PRIVMGT
40-4D06-CANB3
40-4D274-CANC3
40-5A032-HPC
40-5A20-HPBW
40-5A24-HP
40-5A28-HPC
40-5B05-CANC3
40-5B08-CANB3
40-5C32-HPC
40-5D-HPCOR
40-5D02-HP
40-RB-HPBWCOR
40-RC-CORBW
40-RD-HPCOR

3: Submit the job

After having chosen the printer submit the printing job using the following command:

lpr -P <printer_name> -# <number_of_copies> </path/to/document>

Note that here <path/to/document> is the path on lxplus and so if you copied a document over according to step one, the document should be in your home directory and the path will be </path/to/document>=~/<name_of_document>.

For example:

lpr -P 40-4B-HPCOR -# 2 ~/example_document.pdf

4: Clean up

Remove the documents if you are finished with them so as not to clutter your lxplus space.

Note that we can effect this by passing the -r flag to lpr. Example:

lpr -r -P 40-4B-HPCOR -# 2 ~/example_document.pdf

Will delete ~/example_document.pdf after it has been printed.

-- JosephPatrickMariano - 2020-11-02

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2020-11-02 - JosephPatrickMariano
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback