@echo off COLOR 17 mode con: lines=40 cols=71 echo ====================================================================== echo = This script is for Backing Up Structured Analytics = echo = Sets. This Batch file was created by kCura and for use = echo = by kCura Clients Only v7 = echo ====================================================================== :CHOICE echo. echo OPTIONS: echo. echo 1) See all Structured Analytics sets in your environment echo 2) See all Structured Analytics sets in your backup location echo 3) Backup all Structured Analytics Sets in your environment echo 4) Restore all Structured Analytics Sets to your environment echo. set /p type=Make a choice: if %type% == 1 GOTO ONE if %type% == 2 GOTO TWO if %type% == 3 GOTO THREE if %type% == 4 GOTO FOUR echo. echo Please Enter a valid number (1 to 4) echo. GOTO CHOICE :ONE echo ====================================================================== echo = = echo = Gathering Structured Analytics Sets = echo = Staging Areas for Backup = echo = = echo ====================================================================== echo. set /p work=Folder path to your CAAT .ufx\work or .ufx\CAAT folder: dir %work% > C:\CAAT_Staging_Areas.txt /b /o notepad.exe C:\CAAT_Staging_Areas.txt echo. echo. echo. GOTO CHOICE :TWO echo ====================================================================== echo = = echo = Gathering Structured Analytics Sets = echo = Staging Areas from Backup = echo = = echo ====================================================================== echo. set /p "backup=Folder path where your CAAT backups reside: " if not defined backup GOTO :CHOICE dir %backup% > C:\CAAT_Staging_Backups.txt /b /o notepad.exe C:\CAAT_Staging_Backups.txt echo. echo. echo. GOTO CHOICE :THREE echo ====================================================================== echo = = echo = Backing Up all Structured Analytics Sets = echo = = echo ====================================================================== echo. echo. @Echo off setlocal enabledelayedexpansion :AGAIN for %%a in (work staging backup) do set "%%a=" set /p "work=Folder path to your CAAT .ufx\work or .ufx\CAAT Folder: " if not defined work GOTO :CHOICE echo. set /p "staging=Folder path where the staging-backup.cmd file resides: " if not defined staging GOTO :CHOICE echo. set /p "backup=Folder path where you'd like to save your backups to: " if not defined backup GOTO :CHOICE echo. echo ====================================================================== echo = = echo = Backup in Progress = echo = = echo ====================================================================== md %backup% set /a $count=1 PUSHD %staging% for /f "delims=" %%a in ('dir "%work%" /b/o') do ( call staging-backup %%a %backup%\%%a 2>> "C:\CAAT_Backup_Logs.txt" set /a $Count+=1 cd /d %staging% ) echo. echo Backup Complete. Please see c:\CAAT_Backup_Logs.txt for details. echo Feel free to close this window when you are finished. echo. GOTO CHOICE :FOUR echo ====================================================================== echo = = echo = Restoring all Structured Analytics Sets = echo = = echo ====================================================================== echo. echo. @Echo off setlocal enabledelayedexpansion :AGAIN for %%a in (restore backup) do set "%%a=" set /p "restore=Folder path where the staging-restore.cmd file resides: " if not defined restore GOTO :CHOICE echo. set /p "backup=Folder path where your CAAT backups reside: " if not defined backup GOTO :CHOICE echo. echo ====================================================================== echo = = echo = Restore in Progress = echo = = echo ====================================================================== set /a $count=1 PUSHD %restore% for /f "delims=" %%a in ('dir "%backup%" /b/o') do ( call staging-restore %%a %backup%\%%a 2>> "C:\CAAT_Restore_Logs.txt" set /a $Count+=1 cd /d %restore% ) echo. echo Restore Complete. Please see c:\CAAT_Restore_Logs.txt for details. echo Feel free to close this window when you are finished. echo. GOTO CHOICE