View Single Post
Old 10-24-2012, 02:25 PM   #1
Dylan Tomorrow
Connoisseur
Dylan Tomorrow ought to be getting tired of karma fortunes by now.Dylan Tomorrow ought to be getting tired of karma fortunes by now.Dylan Tomorrow ought to be getting tired of karma fortunes by now.Dylan Tomorrow ought to be getting tired of karma fortunes by now.Dylan Tomorrow ought to be getting tired of karma fortunes by now.Dylan Tomorrow ought to be getting tired of karma fortunes by now.Dylan Tomorrow ought to be getting tired of karma fortunes by now.Dylan Tomorrow ought to be getting tired of karma fortunes by now.Dylan Tomorrow ought to be getting tired of karma fortunes by now.Dylan Tomorrow ought to be getting tired of karma fortunes by now.Dylan Tomorrow ought to be getting tired of karma fortunes by now.
 
Posts: 62
Karma: 640495
Join Date: Jul 2012
Location: Germany
Device: Kindle Touch, Android smartphone w/ FBReader
Lightbulb How to easily backup all your notes, marks & reading positions with rsync under Linux

Hi guys,

I have lost the notes, marks and reading positions of my personal docs not synced to the Amazon cloud in the past (e.g. calibre deletes them when you use it to delete ebooks from the device) and wanted to easily back them up locally, especially as those are tiny, tiny files.

Because I already have the whole ebook library in calibre plus a backup I did not want to create another full backup with all the ebook files in it, just those ancillary files.

Enter rsync, one of my favourite Linux command line tools!

I just had to google and read the Manpage a bit and survey the file endings used for the different note formats, and voilá:

Code:
rsync -ahvh --progress --prune-empty-dirs --include-from="rsync-include.txt" --exclude='*' /media/Kindle/documents/ ~/Backups/Kindle/2012-10-24/documents/
wherein the rsync-include.txt reads as follows:

Code:
*/
*.mbp
*.mbp1
*.mbs
*.azw3r
*.azw3f
*.pds
*.pdt
*.tal
*.tas
*.apnx
*.phl
*.asc
*.ea
This preserves the directory structure. Adapt the file paths to your own setup, of course. E.g. on Fedora 16 and above, /media/kindle needs to be changed to /run/media/<user>/Kindle. You may have to mkdir the backup destination directory first.

*.apnx are page numbers, *.phl are public highlights and *.asc are end action (*.ea on the Kindle 3) and X-Ray files, all of which you can refetch from Amazon for their books (so feel free to remove those), but all the other endings are the four times two note and reading position formats for MOBIs, AZW3s (KF8), PDFs and AZW1s (Topaz) respectively.

Includes findings from qlob.

Last edited by Dylan Tomorrow; 11-12-2012 at 11:30 AM. Reason: EDIT1 27th Oct 2012:Added findings from qlob, Thanks!; EDIT2: Added *.mbp
Dylan Tomorrow is offline   Reply With Quote