Quote:
Originally Posted by Debby
I think it would make more sense if it was in one file.
|
I was thinking like this:
Code:
@echo off
REM metafile copy documents
Z:
cd \Debby\My Documents\Calibrelibrary\Debs
REM The default location for the batch file is now is inside your library with the metadata.db file
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
REM Now you have the last 6 copies plus the master of metadata.db in your library folder.
REM Every time the batch file runs, it will throw away the oldest of the 6 and keep the newest.
REM You don't really need the next line, so I remarked it out.
REM move metadata.db.* "Z:\Debby\My Documents\Calibre Saved Libraries\Metafile BU"
REM when the next line runs, it will put the 6 current backups of your metadata AND all your ebooks into your backup folder.
REM so you really don't need to keep them separately in "Metafile BU"
robocopy "Z:\Debby\My Documents\Calibrelibrary\Debs" "Z:\Debby\My Documents\Calibre Saved Libraries\BatchFile BU" /s /purge /xo /r:1 /w:1
REM I didn't check your options, but I assume they will move the contents of "Calibrelibrary\Debs" into "Calibre Saved Libraries\BatchFile BU"
REM You could have just used
REM robocopy "Z:\Debby\My Documents\Calibrelibrary\Debs" "Z:\Debby\My Documents\Calibre Saved Library" /s /purge /xo /r:1 /w:1
Was this clear?
If you need a backed up metadata.db.1, you just find it in:
Z:\Debby\My Documents\Calibre Saved Libraries\BatchFile BU
or in:
Z:\Debby\My Documents\Calibre Saved Library
(If you used the shorter one I suggested).
Quote:
Sorry - I don't understand the syntax
c:\some\place\else\metadata.db.N.
|
I meant this:
Code:
if exist Z:\Debby\My Documents\Calibrelibrary\Debs\metadata.db.6 del Z:\Debby\My Documents\Calibrelibrary\Debs\metadata.db.6
if Z:\Debby\My Documents\Calibrelibrary\Debs\exist metadata.db.5 ren Z:\Debby\My Documents\Calibrelibrary\Debs\metadata.db.5 Z:\Debby\My Documents\Calibrelibrary\Debs\metadata.db.6
...
if exist Z:\Debby\My Documents\Calibrelibrary\Debs\metadata.db copy Z:\Debby\My Documents\Calibrelibrary\Debs\metadata.db Z:\Debby\My Documents\Calibrelibrary\Debs\metadata.db.1
It was just ugly, but it can be run anywhere instead of requiring you to do this first:
Z:
cd \Debby\My Documents\Calibrelibrary\Debs