Originally Posted by Debby
Here is the batch file I created last night and tested. Although it worked, is my syntax correct? I am using a mapped network drive.
xcopy "Z:\Debby\My Documents\Calibrelibrary\Debs" "Z:\Debby\My Documents\Calibre Saved Libraries\BatchFile BU" /D /S /Y
It looks good to me, assuming your directory paths are correct. It relies on the date on the computer being correct, but it normally would be. You can precede it with:
cd \Debby\My Documents\Calibrelibrary\Debs
if exist metadata.db.6 del metadata.db.6
if exist metadata.db.5 ren metadata.db.5 metadata.db.6
if exist metadata.db.4 ren metadata.db.4 metadata.db.5
if exist metadata.db.3 ren metadata.db.3 metadata.db.4
if exist metadata.db.2 ren metadata.db.2 metadata.db.3
if exist metadata.db.1 ren metadata.db.1 metadata.db.2
if exist metadata.db copy metadata.db metadata.db.1
and it will always keep the last 6 copies of your metadata.db.
I like the idea of using kovidgoyal code ....
calibredb export --all --to-dir backup_path
That's a different type of backup, as discussed here. It doesn't keep the metadata.db, recipes, book conversion settings, etc. found in that file. It also will export all books each time it runs. ccayer had some valid comments on XCOPY, and they would apply to doing this type of export. Old files would not be removed. That would make it harder to import later.
IMHO, RichCopy or another sync program would be a better option.