09-06-2013, 07:37 PM | #1 |
Addict
Posts: 238
Karma: 100000
Join Date: Oct 2012
Device: Calibre
|
Auto-update Calibre?
Is there a way to make Calibre automatically update whenever it detects a new version is available, so I don't have to run the following command manually?
Code:
sudo python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main(install_dir='/opt')" |
09-07-2013, 09:21 AM | #2 |
Wizard
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
No, I am afraid not.
I believe there was a policy decision to leave updating as a manual process. Whether there were also technical issues in implementing it I am not sure. With Calibre updates issued every week and most people not wanting all updates this makes sense. I guess it also reduces the load on the servers that deliver updates. |
Advert | |
|
09-07-2013, 12:48 PM | #3 |
Grand Sorcerer
Posts: 12,663
Karma: 74532212
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
If you really wanted to you could just create a simple script that would ensure calobre was not running, and then issue the command required to download and install calibre, then schedule a cron job to run them once a week.
|
09-13-2013, 11:14 AM | #4 | |
Addict
Posts: 238
Karma: 100000
Join Date: Oct 2012
Device: Calibre
|
Quote:
That's a good idea, especially since we know the releases are usually weekly on Fridays. |
|
09-13-2013, 11:54 AM | #5 | |
Well trained by Cats
Posts: 30,421
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Use the CLI to evaluate calibre-debug --version then get http://calibre-ebook.com/downloads/latest_version and do a compare |
|
Advert | |
|
09-14-2013, 02:14 AM | #6 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
|
|
09-18-2013, 02:17 PM | #7 | |
Addict
Posts: 238
Karma: 100000
Join Date: Oct 2012
Device: Calibre
|
Quote:
Here's what I did. calibre_update.sh: Code:
#!/bin/sh killall calibre calibre-server calibre_update.py calibre-server --daemon Code:
#!/usr/bin/python import sys py3 = sys.version_info[0] > 2 u = __import__('urllib.request' if py3 else 'urllib', fromlist=1) exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()) main(install_dir='/opt') Code:
0 0 * * 6 calibre_update.sh > /dev/null 2>&1 & Code:
____________________ WARNING ____________________ Setting up completion failed with error: __________________________________________________ Traceback (most recent call last): File "site-packages/calibre/linux.py", line 525, in setup_completion IOError: [Errno 13] Permesso negato: '/usr/share/bash-completion/calibre' Setting up desktop integration... ____________________ WARNING ____________________ Setting up desktop integration failed with error: __________________________________________________ Traceback (most recent call last): File "site-packages/calibre/linux.py", line 712, in setup_desktop_integration File "site-packages/calibre/linux.py", line 77, in __exit__ IOError: [Errno 13] Permesso negato: '/usr/local/share/applications/defaults.list' ____________________ WARNING ____________________ Creating uninstaller failed with error: __________________________________________________ Traceback (most recent call last): File "site-packages/calibre/linux.py", line 478, in create_uninstaller IOError: [Errno 13] Permesso negato: '/usr/bin/calibre-uninstall' There were 3 warnings * Setting up completion failed with error: * Setting up desktop integration failed with error: * Creating uninstaller failed with error: Run "calibre" to start calibre Last edited by Geremia; 09-18-2013 at 03:45 PM. |
|
09-18-2013, 06:26 PM | #8 |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Thanks for sharing your attempt.
You could always check out the Sticky post below the Windows sticky post which is an OSX solution. The script here may give you some ideas. |
09-20-2013, 10:45 AM | #9 | |
Addict
Posts: 238
Karma: 100000
Join Date: Oct 2012
Device: Calibre
|
It actually works perfectly well when run in the root crontab.
Quote:
|
|
01-28-2014, 01:44 PM | #10 |
Addict
Posts: 238
Karma: 100000
Join Date: Oct 2012
Device: Calibre
|
Actually, this isn't true. For some reason, the cronjob exits with error 127. See this unsolved StackOverflow question.
|
01-28-2014, 02:37 PM | #11 | |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
This thread also has a nice elegant way of checking if there is an update available -- Kovid helped us thrash it out. Here it is: Code:
#!/bin/bash calibre-debug -c "import urllib as u; from calibre.constants import numeric_version; raise SystemExit(int(numeric_version < (tuple(map(int, u.urlopen('http://calibre-ebook.com/downloads/latest_version').read().split('.'))))))" UP_TO_DATE=$? if [ $UP_TO_DATE = 0 ]; then echo "Calibre is up-to-date" else killall calibre calibre-server sudo python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main(install_dir='/opt')" fi Last edited by eschwartz; 01-28-2014 at 03:19 PM. |
|
01-31-2014, 10:48 AM | #12 | |
Addict
Posts: 238
Karma: 100000
Join Date: Oct 2012
Device: Calibre
|
Quote:
Code:
Traceback (most recent call last): File "<string>", line 1, in <module> File "<string>", line 356, in main File "<string>", line 192, in prints TypeError: encode() argument 1 must be string, not None |
|
01-31-2014, 03:54 PM | #13 |
Addict
Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
|
That's... kind of weird. Did you change the "install_dir='/opt'" part of the script? If I look at the code pointed by the traceback, it looks like the installer can't deal with whatever destination directory has been selected, or something.
|
02-07-2014, 04:45 PM | #14 | |
Addict
Posts: 238
Karma: 100000
Join Date: Oct 2012
Device: Calibre
|
Quote:
Yes, it is weird. I don't get the issue when running it manually, but I get the issue when the root (or my non-root user's) crontab runs it. Some strange permissions issue? |
|
02-07-2014, 05:23 PM | #15 |
Addict
Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
|
Maybe we shouldn't try to resolve the same problem on two different threads ^^;;
|
Tags |
calibre, update |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Auto update covers? | mdamsma | Library Management | 4 | 01-29-2013 06:18 PM |
Auto-update Calibre: How-to using PowerShell | FlareHeart | Calibre | 0 | 08-08-2012 05:41 PM |
Auto-update | kapsi | Calibre | 6 | 07-24-2011 12:24 PM |
Auto update | Toxaris | Sigil | 1 | 11-17-2010 05:36 AM |
Auto Update to Connect | Xsavior | Sony Reader | 0 | 10-18-2007 03:07 PM |