Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-20-2010, 01:31 AM   #1
nchall114
Enthusiast
nchall114 began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Apr 2010
Device: Kindle Paperwhite, Kindle for Android
Run Calibre as Task in Windows 7

Hi. I've setup an instance of Calibre through Task Manager in Windows 7 so that it will open early in the morning and download the news articles I am interested in reading. The task is set to repeat every day. It is also set to end the task and close Calibre after 30 min, which it appears to do, but then when it goes to start the next day it does not start.

Is this a limitation of the GUI?

Writing BAT files for everything would be very time consuming and I would like to avoid doing that if possible.

Any ideas on how I can accomplish this?
nchall114 is offline   Reply With Quote
Old 04-20-2010, 09:07 AM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by nchall114 View Post
Hi. I've setup an instance of Calibre through Task Manager in Windows 7 so that it will open early in the morning and download the news articles I am interested in reading. The task is set to repeat every day. It is also set to end the task and close Calibre after 30 min,
Why not just leave calibre running? That's how I do it.
Starson17 is offline   Reply With Quote
Advert
Old 04-20-2010, 10:35 AM   #3
nchall114
Enthusiast
nchall114 began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Apr 2010
Device: Kindle Paperwhite, Kindle for Android
Just seems like a waste of RAM and procesor cycles for something I need to run 10 min a day at most.
nchall114 is offline   Reply With Quote
Old 04-20-2010, 11:26 AM   #4
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by nchall114 View Post
Just seems like a waste of RAM and procesor cycles for something I need to run 10 min a day at most.
OK. How do you stop Calibre automatically? I know Calibre has some trouble with the Windows Command processor. You may need to put "start" in front of the command to stop. Calibre runs other processes when it opens - maybe they are not being stopped.

Alternatively, you can run calibre's standalone recipe and conversion software from the command line or scheduled batch file, then run a command to add it to the database (assuming you want it in the database), or use a sync program to send it to your reader device after it is created.
Starson17 is offline   Reply With Quote
Old 04-20-2010, 01:34 PM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Try running 'calibre-debug -g' instead of calibre.

I built a task specification to run a .bat file that sets a few environment variables (because I didn't want the test to touch my real library), then runs calibre-debug -g. It runs it every 5 minutes, killing it after 1. It has been happily doing this for 20 minutes. I haven't tried running it when I am not logged in, so can't say whether not having a screen will cause the GUI difficulties.

I suspect that running calibre-debug gives the task scheduler a convenient process to kill.
chaley is offline   Reply With Quote
Advert
Old 04-20-2010, 06:29 PM   #6
nchall114
Enthusiast
nchall114 began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Apr 2010
Device: Kindle Paperwhite, Kindle for Android
So it seems like there is no easy to do it through Task Manager. I'll keep exploring other options and post back.

Thanks!
nchall114 is offline   Reply With Quote
Old 04-20-2010, 06:36 PM   #7
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by nchall114 View Post
So it seems like there is no easy to do it through Task Manager. I'll keep exploring other options and post back.

I used the W7 task manager for my experiment, and it was easy to set up using the wizard and then adjusting a few properties. The only reason I used a .bat file was to set two ENV variables so that the job did not touch my production library. You should be able to directly run calibre-debug, putting the '-g' into the parameters box.

Perhaps I don't understand what you are trying to do?
chaley is offline   Reply With Quote
Old 04-20-2010, 06:49 PM   #8
nchall114
Enthusiast
nchall114 began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Apr 2010
Device: Kindle Paperwhite, Kindle for Android
I understand what you're saying, and I really appreciate the advice, but I've tried your suggestion and while it does start I am not able to get it to quit after a set amount of time using the Task Scheduler properties. How are you accomplishing this?

Last edited by nchall114; 04-20-2010 at 07:04 PM. Reason: More detailed explanation.
nchall114 is offline   Reply With Quote
Old 04-20-2010, 07:08 PM   #9
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I told the task manager to start it after 5 minutes and kill it after 1 minute. To be more precise, I created a trigger tab saying 'begin task on a schedule', 'start one time', and 'repeat every 5 minutes'. You would want to repeat every 1 day for many days. It might also work if you scheduled it for daily without repeats. Under the 'settings' tab I checked 'stop the task' and entered '1 minute' in the box. You might want to give it more time. I also checked the box 'if the running task does not end... force it'. In the General tab, I checked 'only run when user is logged in', because I didn't feel like logging out to test it. As I said before, there might be a problem if you intend to run the task in the background.

The bat file contains:
Code:
set CALIBRE_CONFIG_DIRECTORY=...\calibre_development\config_test_device
set CALIBRE_DEVELOP_FROM=...\calibre_development\calibre\src
calibre-debug -g
The ... in the env variable sets are a fairly long path. As I said before, I set the env variables because I didn't want my production library touched. I don't think you need to set them, and in fact you can't set the DEVELOP_FROM variable if you don't have source code installed.
chaley is offline   Reply With Quote
Old 04-21-2010, 08:58 AM   #10
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by chaley View Post
in fact you can't set the DEVELOP_FROM variable if you don't have source code installed.
Actually, you can, it just doesn't do anything. If source is not there, it rolls over to installed exe code. I install the current exe and the source. I often rename my source directory (so the DEVELOP_FROM variable no longer points to any source), then restart calibre to see the exe version run when I want to compare how my code functions to what the exe code does.
Starson17 is offline   Reply With Quote
Old 04-22-2010, 10:29 AM   #11
nchall114
Enthusiast
nchall114 began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Apr 2010
Device: Kindle Paperwhite, Kindle for Android
Ok. I think the issue is that if you try and start it as a program through Task Scheduler it gets confused and doesn't close all the associated processes. If you start it using the calibre-debug -g handle from a .bat file, it just kills that .bat file which kills all the associated processess. Seems a little hacky, but works.

Thanks for your help!

Hope this works for others as well.
nchall114 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installer doesn't run on Windows 7 drogo Calibre 5 02-09-2009 08:13 PM
Run from Source on Windows? itimpi Calibre 12 01-22-2009 04:34 AM
Can eink devices run Windows Mobile? da_jane News 11 10-14-2006 09:34 AM


All times are GMT -4. The time now is 12:32 AM.


MobileRead.com is a privately owned, operated and funded community.