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)