Turbocharge your ebook reader with KOReader
Backing Up KOReader's Data
For each book, KOReader creates a metadata file that contains book settings, notes, current position, etc. While you can sync the current position and export notes, it also makes sense to keep a backup of all the important data. To make it easier to manage both the content and metadata, use a dedicated directory on your e-reader for storing all ebooks (for example, Library
). This way, you can back up everything by syncing the directory and its entire contents using rsync
. There are two ways to do that.
The simplest approach is to connect the e-reader on a machine that has rsync
. Most Linux distributions automatically detect and mount a connected e-reader. Then it's a matter of running the appropriate rsync
command. For example:
rsync -avh --delete /path/to/ereader/Library/ /path/to/backup/dir
Replace /path/to/ereader/Library/
with the actual path to the Library
directory on the mounted e-reader and /path/to/backup/dir
with the path to the directory for storing backup data.
A slightly more technical but versatile approach is to install rsync
on the e-reader so you can run backup operations directly on the device itself. To install rsync
on a Kobo device, download and install the KoboStuff package [4]. Launch KOReader, open the top bar, switch to Tools | More tools | Terminal emulator, and tap Open terminal session. Run the rsync
command that syncs the content of the Library
directory to a Linux machine. Here's an example command you can use to back up the data to a Linux server running on a local network:
rsync -avhz --delete -P -e "ssh -p 22" /mnt/onboard/Library/ user@127.0.0.1:/path/to/library
Instead of typing long rsync
commands using the built-in keyboard, you can speed up the process by adding the desired commands to the koreader/.ash_history
file. Alternatively, you can write a shell script to automate the task. Create a text file named backup.sh
in the koreader/scripts/
directory and add the following code (adjust the examples as needed):
#!/bin/sh rsync -avhz --delete -P -e "ssh -p 22" /mnt/onboard/Library/USER@127.0.0.1:/path/to/library rsync -avhz --delete -P -e "ssh -p 22" /mnt/onboard/.adds/koreader/clipboard/USER@127.0.0.1:/path/to/export
Save the file and make it executable using:
chmod +x /koreader/scripts/up.sh
To launch the script in the e-reader, open the terminal emulator and run the koreader/scripts/backup.sh
command.
If you happen to use a second e-reader, and you want to download the saved settings and data, all you have to do is to create a shell script that runs the following commands:
rsync -avhz --delete --no-g --no-o -P -e "ssh -p 22" USER@127.0.0.1:/path/to/library//mnt/onboard/Library rsync -avhz --delete --no-g --no-o -P -e "ssh -p 22" USER@127.0.0.1:/path/to/clipboard//mnt/onboard/.adds/koreader/clipboard
Every time you run the scripts described above, you'll be prompted to enter the password twice, which can quickly become a nuisance. To fix this, generate an SSH key pair in KOReader, and add the public key to the list of authorized keys on the remote machine.
To generate an SSH key pair, launch the terminal emulator in KOReader and run the ssh-keygen
command. Follow the prompts, but skip specifying a passphrase. This generates a key pair in the /usr/local/niluje/usbnet/etc/dot.ssh/
directory. To make sure that the keys are there, run:
ssh-agent sh -c 'ssh-add; ssh-add -L'
Copy the /usr/local/niluje/usbnet/etc/dot.ssh/id_rsa.pub
file to a Linux machine, and use the command below to add it to the authorized_keys
file on the remote server:
cat id_rsa.pub | ssh USER@127.0.0.1 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
From now on you can run the shell scripts (or any commands and actions that require an SSH connection to the remote machine) without a password.
Wrap Up
You don't have to stop here, because KOReader has so much more to offer. Dive into its gesture controls, and you'll discover that you can control practically every aspect of the application via gestures. Once you've configured gestures to your liking, explore KOReader's reading statistics. In short, you'd be hard pressed to find a better and more powerful reading application. And if you are willing to put some effort and time into learning its functionality, you'll be rewarded with a reading experience you never thought was possible.
Infos
- KOReader: https://github.com/koreader/koreader
- KOReader wiki: https://github.com/koreader/koreader/wiki
- Joplin: https://joplinapp.org
- KoboStuff: https://www.mobileread.com/forums/showthread.php?t=254214
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Red Hat Adds New Deployment Option for Enterprise Linux Platforms
Red Hat has re-imagined enterprise Linux for an AI future with Image Mode.
-
OSJH and LPI Release 2024 Open Source Pros Job Survey Results
See what open source professionals look for in a new role.
-
Proton 9.0-1 Released to Improve Gaming with Steam
The latest release of Proton 9 adds several improvements and fixes an issue that has been problematic for Linux users.
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.