FAQ : EMSRV : Q: Is there a simple approach to EMSRV backup on Linux?
Q: Is there a simple approach to EMSRV backup on Linux?
Problem
We need a simple scheme for backing up a live EMSRV manager hosted on a Linux machine
Solution
The following scheme is a simple backup mechanism for an ENVY manager hosted on a Linux machine. With a small amount of tweaking it should also run well on Solaris or AIX.
Assumptions:
1. Emsrv is being run under the emsrv user id.
2. The scripts are kept in /home/emsrv/bin
3. The manager is in the default location: /usr/local/VASmalltalk/8.0/manager/mgr80.dat
4. Backup files are to be kept in /backups
5. A working version of INFO-ZIP (zip) is installed in emsrv's PATH.
6. A rolling backup - one each weekday - is to be maintained.
Setup cron jobs to run our backup. Here is a sample crontab listing for the user emsrv:
#-------------------------------------------------------------------
# backup VAST manager every weekday at 8:00PM
#
0 20 * * 1 /home/emsrv/bin/backup-mgr.sh mon
0 20 * * 2 /home/emsrv/bin/backup-mgr.sh tue
0 20 * * 3 /home/emsrv/bin/backup-mgr.sh wed
0 20 * * 4 /home/emsrv/bin/backup-mgr.sh thu
0 20 * * 5 /home/emsrv/bin/backup-mgr.sh fri
#---------------------------------------------------------------------
Place the following two scripts, backup-mgr.sh and zipcopy.sh into /home/emsrv/bin. Make sure to set the executable bit (chmod +x).
zipcopy.sh:
#!/bin/bash
# $1 = sourceManager
# $2 = targetZip
zip -9 -j $2 $1
backup-mgr.sh:
#!/bin/bash
# Backup a local ENVY manager.
# Parameters:
# $1 - id of this backup file. (mon, tue, etc.)
#
 
sourceManager=/usr/local/VASmalltalk/8.0/manager/mgr80.dat
compressedManager=/backups/mgr80-$1.zip
logFile=${compressedManager}.log
emsrvPassword=secret
binDir=/home/emsrv/bin # or wherever you keeps these scripts
 
# --------------------------------------------------------------------
# Remove the old backup file if it exists.
# --------------------------------------------------------------------
test -e $compressedManager && rm -f $compressedManager
 
# --------------------------------------------------------------------
# Make the manager zip using the emadmin utility + zip script.
# Use emadmin so that the manager library will be locked during
# the backup (zip) activity.
#
# Note: the emadmin copy command will execute zipcopy with
# $sourceManager as the first parameter and
# $compressedManager as the second parameter.
# --------------------------------------------------------------------
$binDir/emadmin copy $sourceManager $compressedManager –f
$binDir/zipcopy.sh -p $emsrvPassword -o >> $logFile
 
# --------------------------------------------------------------------
# If the output file is not on a filesystem which is subject
# to regular off-line backups, then this would be a good place
# to insert logic to copy or ftp the zipped manager to
# an area with regular tape backup.
# --------------------------------------------------------------------
Last modified date: 01/29/2015