LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-02-2007, 04:54 AM   #1
marisdembovskis
Member
 
Registered: May 2006
Posts: 37

Rep: Reputation: 15
How to apply cups printer from command line?


Hi.
I have printer ok.
But sometimes I need to reapply it and I want to make automatically.

So Anybody knows command how to apply printer in terminal???


I NEED THAT COMAND!

ANY HELP APPRECIATED, GUYS!
 
Old 11-02-2007, 10:57 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Not sure what "reapplying a printer" might be, but have
you looked at 'man lpadmin'?



Cheers,
Tink
 
Old 11-03-2007, 08:25 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
To print from a terminal, there is "lp". To use this, the printer has to be set as the default (even if it is the only printer on the system)
 
Old 11-05-2007, 06:04 AM   #4
marisdembovskis
Member
 
Registered: May 2006
Posts: 37

Original Poster
Rep: Reputation: 15
1. I use this command to remove all print queue what I have.
lprm *
2. Then I need to Apply (press that button on Printer configuration tool) the default printer again.

what command I need to type to get Apply again for default printer?

thank you guys for helping me out.
m.
 
Old 11-05-2007, 11:13 AM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I still have no idea which apply button in which printer
configuration tool you're talking about, and what exactly
you're applying. If you managed to tell us that we may be
able to get you in the right direction...

lprm *
just deletes all queued jobs and doesn't do any modifications
to the printer object.



Cheers,
Tink
 
Old 11-06-2007, 02:35 AM   #6
marisdembovskis
Member
 
Registered: May 2006
Posts: 37

Original Poster
Rep: Reputation: 15
Thank you for your reply.

Well yes that lprm removes all queue.
Situation I have, lpr gives jobs to print, once per 3 months printer is switched off or something like that.

So lpr sends jobs, but they are not prited. But they stand in queue. So when this happens, the only thing how I can manage that printer prints againg is to go to my fax server. Remove from terminal with lprm all printing jobs and go to Administration -> Printing ->
click on my default printer -> APPLY -> Close
(I have tried click on save, does not help either)

after these steps printing again works fine. Without apply it doesn t print, have tried a lot of. only be apply clicking on default printer somehow accepts new jobs.


so what I want to do is put script, which after every reboot
1. removes all printing jobs lprm * (if there is any)
2. and need command which does the same as pushing Apply button on printer congfig tool.


and I need help on 2 point.
thank you for your help guys!
 
Old 11-06-2007, 03:03 AM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by marisdembovskis View Post

Remove from terminal with lprm all printing jobs and go to Administration -> Printing ->
click on my default printer -> APPLY -> Close
(I have tried click on save, does not help either)
*sigh*

I don't KNOW which window manager or desktop environment you're
using. I use fluxbox - there is no Administration -> Printing
-> default printer.

Hence I still don't know what kind of tool you're using, and what
that apply button does. Can you please tell us what tool that is
in which you click on apply?




Cheers,
Tink
 
Old 11-06-2007, 06:20 AM   #8
synapse
Member
 
Registered: Jan 2004
Location: On Planet Earth.
Distribution: Slackware 12
Posts: 244

Rep: Reputation: 30
looks like he wants to add a printer using the command line only as the printer keeps mysteriously dissapearing.

So his solution is to delete the print q and then setup the printer on each startup ?

Last edited by synapse; 11-06-2007 at 06:21 AM.
 
Old 11-07-2007, 02:52 AM   #9
marisdembovskis
Member
 
Registered: May 2006
Posts: 37

Original Poster
Rep: Reputation: 15
the tool what Im using in Fedora is:
system-config-printer-gui
(if you run this tool from terminal)
So there is option to add printer, delete, etc.
I need the existing printer reapply. I have a printer and its working fine, just I need to via terminal APPLY it.

(clicking apply button solves me problems)
something like this image is shown and Im clicking on Edit and Then Apply. And problems with no printing are gone.

http://www.catb.org/~esr/writings/ta...printconf1.png
 
Old 11-07-2007, 07:06 AM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
The light goes on!! In the typical GUI dialog, "apply" simply means to proceed with the changes. There is no equivalent in a terminal---ie you simply type commands.

Are you saying that you can get your printer working by going to this dialog and --without making any changes--just hit the "apply" button?

I wonder if simply re-starting the cups server would work? Here is the documentation showing all the command-line functions:
http://www.cups.org/documentation.php
 
Old 11-08-2007, 01:40 AM   #11
marisdembovskis
Member
 
Registered: May 2006
Posts: 37

Original Poster
Rep: Reputation: 15
Hei.
Thank you for helping...

1. service cups restart - doesnt give any fruit It doesn't start printing existing queue.

2. Yah, you understood right. I need from command line do the same as in Pinter Config Tooll i click "Edit" change nothing then click "Apply".

and I need command for that.
 
Old 11-08-2007, 07:51 AM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I said earlier that there is no equivalent terminal command, but that's not strictly correct. Every GUI is a front end for some more basic command. As a mimimum, your particular GUI tool probably writes to some file when you click "apply"---even though you made no changes.

If I were dealing with this problem, I would try to find out why the printer gets "lost", and not writing a script to get it restarted. If you don't know what is causing the behavior--ie the "root cause", then you have no assurance that you script will always work.
 
Old 11-08-2007, 12:20 PM   #13
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
OK ... so I have NO idea what Gnome does, or what
Gnome's printer configuration tool does.

My mother-in-laws Epson has the odd habit of not
wanting to work occasionally (if some print-job
fails the queue gets turned off) ...

I'd suggest that you try
'cupsenable QUEUENAME'


Cheers,
Tink

Last edited by Tinkster; 11-08-2007 at 01:01 PM. Reason: fixed nasty typo
 
Old 11-09-2007, 02:56 AM   #14
marisdembovskis
Member
 
Registered: May 2006
Posts: 37

Original Poster
Rep: Reputation: 15
thank you.
Will try:
'cupsenable QUEUENAME'
first I need to get situation when printer will no be available so there will be some lp queue and printer will not work. then I will try to apply and see what happens.


Thank you guys for help.
really appreciate your given time to solve my problem.
 
Old 11-09-2007, 03:16 AM   #15
SqdnGuns
Senior Member
 
Registered: Aug 2005
Location: Pensacola, FL
Distribution: Slackware64® Current & Arch
Posts: 1,092

Rep: Reputation: 174Reputation: 174
You have a browser:

http://localhost:631/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Configure DNS printer via CUPS command line adagbg Red Hat 0 03-09-2005 10:46 AM
CUPS Command Line zaicheke Linux - Software 1 11-25-2004 03:26 PM
print from command line, normally use cups itsjustme Linux - General 2 06-14-2004 11:14 AM
CUPS + command line chrisk5527 Linux - Software 1 03-01-2004 12:05 AM
Where is Command line utility for Cups and command tutorial mossy Linux - Software 8 01-16-2004 12:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration