![]() |
Command line instruction to export all data ?
Hi
(Windows 10, calibre 3.27) I've used the option "Export all your data" (not sure of the name in english) from the Library menu to transfer my library and all the settings, extensions, etc., to my laptop. It's a great tool, it worked very well and I now have an exact copy on my laptop. Is there a way to do the export via the CLI ? I'd like to run this option via a batch file + Windows Task Scheduler. (I already do this with "calibredb export" but if I'm not mistaken, it's only to export books, not the whole calibre configuration.) I didn't find anything in the doc. Thanks. |
calibre-debug --export-all-calibre-data
|
Thanks, but when prompted for a path, I keep getting an error about the syntax.
Code:
> calibre-debug --export-all-calibre-dataCode:
Python function terminated unexpectedly |
Strange, I dont see anything that could cause that. You can always create the emty directory yourself first the calibre will not try to create it.
|
Never mind, I see it is because there is an extra carriage return at the end of the directory name -- probably something weird about the console in your system? Are you running it in cygwin or a normal windows command prompt?
|
I'm using ConEmu (https://conemu.github.io/).
But I tried with a normal windows command prompt and the end of the error message is different now. Folder created in File Explorer before running the command : Code:
C:\>calibre-debug --export-all-calibre-dataFolder not created before running the command, same result : Code:
C:\>calibre-debug --export-all-calibre-data |
I have no idea why your console is doing that, but in any case, since \r is not legal in filenames, this should work around it: https://github.com/kovidgoyal/calibr...ba5bea9cb26db4
|
Thanks Kovid.
I'll check again at the next calibre update. (I just tested on my laptop (Windows 10 fresh install) and I have the same error) |
@Kovid,
I just recognize the old version had not worked for me too and I had forgot to report that some when in May. I just see the remark in my script :o I run your new modification from source. It is a bit better as I can now pass a backup directory, but if I select only one of the libraries no library will be backup. Spoiler:
I have a little additional request. Is it possible to add some arguments for scripting? I like to pass a backup directory and in addition only dedicated libraries or "all" as parameters. No parameter means the original behavior as it is now. This would be very helpful. |
There you go: https://github.com/kovidgoyal/calibr...836c2d918bb6a1
|
Thank you very much.
I test from command line and select some of the libraries. This worked very well. Same for scripting. The only thing what I was not able to do: all libraries as script. For those who like to test: calibre-debug --export-all-calibre-data [backup_dir] [library1] [library2] ... Needs absolute paths for the export directory and libraries and quotation marks if path or library names include spaces. Sample script: calibre-debug --export-all-calibre-data c:\path\to\backup_dir C:\path\to\first\library\library_name "C:\path with space\to\second\library name" [...] |
|
Sweet. This works perfect. Just finished a backup about 68GB on my test system.
Question, do you need to modify --import-calibre-data as well? I've trouble to run this via cmd on my test system. There seems to be the same behavior for passing a backup directory. Spoiler:
It would be nice having the scripting similar to the exporter :) |
I will fix the import input, but I dont see the point of making it scriptable. It's not like it needs to be run regularly.
|
Yes, I understood.
The additional request was more for having a automated test scenario to verify a backup w/o the need for checking this personally. :) |
| All times are GMT -4. The time now is 09:38 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.