LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-06-2009, 09:31 AM   #1
nusch
LQ Newbie
 
Registered: Feb 2009
Posts: 14

Rep: Reputation: 0
Anacron changing default printer on weekends


From Monday to Friday I'm with my laptop at location_one and using printer_one, and at weekends I'm at location_two and using printer_two. I want to change CUPS default printer respectively with command
Code:
lpadmin -d printer_one
run on Mondays and
Code:
lpadmin -d printer_two
run on Fridays in Anacron. But I see there is possibility to only specify time interval not weekdays, is what I'm trying to achieve possible without complicated bash scripts?
 
Old 12-06-2009, 09:59 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Take a look also at the "at" command.

Regardless, I would think that a very straightforward solution would be an "anacron" job that runs every day and sets the default printer based on the output of "date +%u"
 
Old 12-06-2009, 11:09 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by pixellany View Post
Take a look also at the "at" command.

Regardless, I would think that a very straightforward solution would be an "anacron" job that runs every day and sets the default printer based on the output of "date +%u"
Or, if you do boot regularly (rather than suspend-resuming) similar could be done in a boot script.
 
Old 12-06-2009, 04:38 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Or both, n'est-ce pas?
 
Old 12-07-2009, 03:05 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by pixellany View Post
Or both, n'est-ce pas?
Bien sur, certainment
 
  


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
Changing default OS in grub2. guns90 Linux - Software 9 05-30-2012 10:30 PM
changing default to zero ramjgn Linux - Newbie 7 04-03-2009 11:20 PM
changing the default chmod KOmaSHOOTER Linux - General 3 07-16-2003 12:20 AM
Changing Lilos Default OS iPhusion Linux - Software 5 07-15-2003 05:08 PM
changing default WM pmh6310 Linux - Newbie 5 06-11-2003 05:00 PM

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

All times are GMT -5. The time now is 01:34 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