BookShift transfers e-books from network shares or email to a local folder (e.g., your Kobo device). It’s designed for simple, repeatable syncs from NAS or inbox to your reader.
- Download book files from NFS shares
- Download book files from SMB shares
- Download book attachments from an email account (IMAP)
-
Run with a config file:
bookshift run -c config.yaml- Or via env:
BOOKSHIFT_CONFIG_FILE=/path/to/config.yaml bookshift run
-
Useful flags for
run:--dry-runShow what would be done without creating, writing, or deleting files.--no-progressDisable progress bars during downloads.
-
Global:
-c, --config-filePath to configuration file (defaults toconfig.yaml).-v, --versionPrint version and exit.
Notes:
- When new books are downloaded and a Kobo device is detected, the library is refreshed automatically (via NickelDBus or simulated USB plug).
- File extension matching is case-insensitive.
- Concurrency: sources are processed in parallel. Control with
concurrencyin the config (default: 3). BookShift also supports cancellation: press Ctrl+C to stop; in-flight operations will respect per-source timeouts or cancel between files/messages.
Top-level keys:
log_level: one ofdebug,info,warn,error(default:info).target_folder: required, local folder to place downloaded books.overwrite_existing_files: overwrite existing destination files when true.valid_extensions: list of allowed extensions (e.g.[".epub", ".kepub"]).sources: list of source definitions; each has atypeand aconfigblock.concurrency: optional, number of sources to process in parallel (default 3).
Example config:
log_level: info
target_folder: /mnt/books
overwrite_existing_files: false
valid_extensions: [".epub", ".kepub"]
sources:
- type: smb
config:
host: fileserver.local
port: 445 # optional (default 445)
username: alice
password: secret
domain: WORKGROUP
share: books
folder: incoming
keep_folderstructure: true
remove_files_after_download: false
timeout_seconds: 120 # optional per-source timeout
- type: nfs
config:
host: nas.local
port: 2049 # optional (default 2049)
folder: /export/books
keep_folderstructure: false
remove_files_after_download: false
timeout_seconds: 120
- type: imap
config:
host: mail.example
port: 143 # optional (default 143)
username: reader
password: secret
mailbox: INBOX
filter_field: subject # one of: to, subject
filter_value: "[BOOK]"
process_read_emails: false
remove_emails_after_download: true
timeout_seconds: 180Source notes:
- SMB:
shareis the share name;folderis the path inside the share. - NFS:
folderis the exported path; remote paths use forward slashes. - IMAP: Attachments are filtered by extension and decoded using the part’s transfer-encoding (base64, quoted-printable, etc.). When unspecified, base64 is assumed for attachments.
Cancellation: IMAP sync checks for cancellation between messages; per-source
timeout_secondsbounds the session.
Cancellation and timeouts:
- Press Ctrl+C to cancel an ongoing run. BookShift will stop starting new source syncs and each active source will exit promptly.
- Per-source
timeout_secondsputs an upper bound on a source run. If exceeded, that source aborts with a timeout error and other sources continue.
BookShift integrates with NickelMenu and NickelDBus. Even though they are not required, it benefits from having them installed.
Grab the KoboRoot.tgz file from the latest release and transfer this to your Kobo device by connecting it to your computer and placing the file in the .kobo folder on the exposed drive.
Finally, disconnect the device from your computer and wait for it to restart. Once the restart is complete BookShift will be installed.
Modify the config.yaml file in the .adds/bookshift folder to set up BookShift.
Place a file named UNINSTALL in the .adds/bookshift folder to uninstall BookShift from your Kobo reader.