Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-06-2013, 07:37 PM   #1
Geremia
Addict
Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!
 
Posts: 235
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')"
thanks
Geremia is offline   Reply With Quote
Old 09-07-2013, 09:21 AM   #2
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
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.
itimpi is offline   Reply With Quote
Advert
Old 09-07-2013, 12:48 PM   #3
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,157
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
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.
PeterT is offline   Reply With Quote
Old 09-13-2013, 11:14 AM   #4
Geremia
Addict
Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!
 
Posts: 235
Karma: 100000
Join Date: Oct 2012
Device: Calibre
Quote:
Originally Posted by PeterT View Post
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.
Thanks
That's a good idea, especially since we know the releases are usually weekly on Fridays.
Geremia is offline   Reply With Quote
Old 09-13-2013, 11:54 AM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,781
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Geremia View Post
Thanks
That's a good idea, especially since we know the releases are usually weekly on Fridays.
A couple of things you could do to eliminate traffic/bogus updates when the schedule is 'off'

Use the CLI to evaluate calibre-debug --version
then get http://calibre-ebook.com/downloads/latest_version
and do a compare
theducks is offline   Reply With Quote
Advert
Old 09-14-2013, 02:14 AM   #6
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by Geremia View Post
Thanks
That's a good idea, especially since we know the releases are usually weekly on Fridays.
You could check out this thread found in the Related Tools forum.
DoctorOhh is offline   Reply With Quote
Old 09-18-2013, 02:17 PM   #7
Geremia
Addict
Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!
 
Posts: 235
Karma: 100000
Join Date: Oct 2012
Device: Calibre
Quote:
Originally Posted by DoctorOhh View Post
You could check out this thread found in the Related Tools forum.
Thanks, but that's for Windows.

Here's what I did.

calibre_update.sh:
Code:
#!/bin/sh
killall calibre calibre-server
calibre_update.py
calibre-server --daemon
calibre_update.py:
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')
and added the following line to my Crontab
Code:
0 0 * * 6 calibre_update.sh > /dev/null 2>&1 &
the only issue is permissions. I changed everything in /opt/calibre/ to my non-root user permissions, so when updating calibre, it yielded these warnings:
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
I guess it's no big deal, but I could use the root crontab instead.

Last edited by Geremia; 09-18-2013 at 03:45 PM.
Geremia is offline   Reply With Quote
Old 09-18-2013, 06:26 PM   #8
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Thanks for sharing your attempt.

Quote:
Originally Posted by Geremia View Post
Thanks, but that's for Windows.
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.
DoctorOhh is offline   Reply With Quote
Old 09-20-2013, 10:45 AM   #9
Geremia
Addict
Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!
 
Posts: 235
Karma: 100000
Join Date: Oct 2012
Device: Calibre
Quote:
Originally Posted by DoctorOhh View Post
Thanks for sharing your attempt.
It actually works perfectly well when run in the root crontab.
Quote:
Originally Posted by DoctorOhh View Post
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.
Thanks
Geremia is offline   Reply With Quote
Old 01-28-2014, 01:44 PM   #10
Geremia
Addict
Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!
 
Posts: 235
Karma: 100000
Join Date: Oct 2012
Device: Calibre
Quote:
Originally Posted by Geremia View Post
It actually works perfectly well when run in the root crontab.
Actually, this isn't true. For some reason, the cronjob exits with error 127. See this unsolved StackOverflow question.
Geremia is offline   Reply With Quote
Old 01-28-2014, 02:37 PM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
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:
Originally Posted by Geremia View Post
Actually, this isn't true. For some reason, the cronjob exits with error 127. See this unsolved StackOverflow question.
And Kovid fixed that. See here: Official calibre PPA? where we discussed updating via a script using that check.

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.
eschwartz is offline   Reply With Quote
Old 01-31-2014, 10:48 AM   #12
Geremia
Addict
Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!
 
Posts: 235
Karma: 100000
Join Date: Oct 2012
Device: Calibre
Quote:
Originally Posted by eschwartz View Post
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
Wow, thanks for that, but I get this error:
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
Geremia is offline   Reply With Quote
Old 01-31-2014, 03:54 PM   #13
aleyx
Addict
aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.
 
Posts: 245
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Cybook Diva
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.
aleyx is offline   Reply With Quote
Old 02-07-2014, 04:45 PM   #14
Geremia
Addict
Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!
 
Posts: 235
Karma: 100000
Join Date: Oct 2012
Device: Calibre
Quote:
Originally Posted by aleyx View Post
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.
No, I didn't change anything…

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?
Geremia is offline   Reply With Quote
Old 02-07-2014, 05:23 PM   #15
aleyx
Addict
aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.
 
Posts: 245
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Cybook Diva
Maybe we shouldn't try to resolve the same problem on two different threads ^^;;
aleyx is offline   Reply With Quote
Reply

Tags
calibre, update


Forum Jump

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


All times are GMT -4. The time now is 11:39 AM.


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