@ECHO OFF REM RMfullbackup7zip.bat REM RMfullbackup.bat by Tom Holden 2011-02-02 REM Rev 2011-03-20: uses free 7-Zip utility to create a .rmgb backup compatible with RootsMagic Restore function REM Backs up a RootsMagic database file and all the media files referenced by it to one, compressed ZIP type file. REM Command syntax: RMfullbackup.bat REM This batch file should be in the same folder as the database and expects a Backups folder immediately below it. REM All media files must be in subsidiary folders below the database folder or in the same folder. If not, then REM the SET variables must be revised so that the contentPath is common to the database and media paths. REM Close the database file from RootsMagic before running. REM The first backup can take considerable time, depending on the total of the file sizes. REM To save time on subsequent backups, RMfullbackup merely updates the backup file for those files added, changed or deleted. REM Install the SQLite3 command line version in the same directory as the RMGC database file(s) REM OR set a system PATH to where sqlite3.exe is located REM OR prepend the path to sqlite3.exe in the command below. REM Likewise for 7z.exe REM Under the RM Data folder, create a folder Backups; if a different path is to be used, edit the command line below. REM The backup file will be written to the Backups folder and will have the name _fullbackup.rmgb REM A log will also be written to the Backups folder with the name _fullback.rmgb.log REM ***set variables SET archiver=C:\Program Files\7-Zip\7z.exe SET contentPath=.\ SET list=.\Backups\backup.lst SET archive=Backups\%1_fullbackup.rmgb REM ***run sqlite query to get list of media files to be backed up sqlite3.exe %1.rmgc "SELECT DISTINCT trim(MediaFile) from MultiMediaTable;" > "%list%" REM ***change directory to the root path common to both the database and media files. cd /d "%contentPath%" REM backup media files listed by query followed by the database file "%archiver%" u -tzip "%archive%" @"%list%" %1.rmgc -r > "%archive%.log" PAUSE END