FAQ : EMSRV : Q: Is there a simple approach to EMSRV backup on Windows?
Q: Is there a simple approach to EMSRV backup on Windows?
Problem
We need a simple scheme for backing up a live EMSRV manager hosted on a Windows machine.
Solution
The following scheme is a simple backup mechanism for an ENVY manager hosted on a Windows machine.
Assumptions:
1. Emsrv is being run under a user id with password largetalk.
2. The managers to be backed up are in directory d:\vamgr\manager
3. Backup files are kept in directory f:\vamgr\backup
4. If the f: drive is not available (it is a removable drive), backup to directory d:\vamgr\backup instead
5. A working version of WinZip is installed (if zipping the backups)
6. A rolling backup is to be maintained (4 copies)
Create a bumgr.bat file like this (if zipping the backup):
rem Backup managers by copying to temp space and zipping to backup drive -- 4 copies max

setlocal

set sourceDir=d:\vamgr\manager
set targetDir=f:\vamgr\backup
if not exist %targetDir% (
  set targetDir=d:\vamgr\backup
  echo Normal backup directories are not available, reverting to %targetDir%
  pause
  )

for %%i in (vavm020304_dev.dat mgr85-working.dat) do (
  del %targetDir%\%%i-4.zip
  ren %targetDir%\%%i-3.zip %%i-4.zip
  ren %targetDir%\%%i-2.zip %%i-3.zip
  ren %targetDir%\%%i-1.zip %%i-2.zip
  d:\vamgr\bin\emadmin copy %sourceDir%\%%i %temp%\%%i -p largetalk
  "c:\Program Files (x86)\WinZip\wzzip" %targetDir%\%%i-1.zip %temp%\%%i
  del %temp%\%%i
  )

endlocal
Create a bumgr.bat file like this (if not zipping the backup):
rem Backup managers by copying to backup drive -- 4 copies max

setlocal

set sourceDir=d:\vamgr\manager
set targetDir=f:\vamgr\backup
if not exist %targetDir% (
  set targetDir=d:\vamgr\backup
  echo Normal backup directories are not available, reverting to %targetDir%
  pause
  )

for %%i in (vavm020304_dev.dat mgr85-working.dat) do (
  del %targetDir%\%%i-4.dat
  ren %targetDir%\%%i-3.dat %%i-4.dat
  ren %targetDir%\%%i-2.dat %%i-3.dat
  ren %targetDir%\%%i-1.dat %%i-2.dat
  d:\vamgr\bin\emadmin copy %sourceDir%\%%i %targetDir%\%%i-1.dat -p largetalk
  )

endlocal
Run the .bat file twice to ensure it is working properly and then use the Windows Task Scheduler to run the .bat file on a periodic basis. Information on using the Windows Task Scheduler differs based on the version of Windows you are running, so you should refer to the Windows Help and Support for your version for instructions.
Last modified date: 01/29/2015