#!/bin/bash
#
# Script to backup Innovative Library System
#
# May 23, 2005 ;rdj; created
#
# This script uses the III API called iiictl. The command is located in the
# /usr/sbin directory. The plan is to create a daily backup directory and then
# run iiictl to copy the Innovative files into it.
# Then Backup Exec will copy those files and all system files on it's normal run.
# Backup Exec will not backup the III directories.
#
mount | grep noexec | grep tmp
echo "Starting III backup on `date`"
# make sure the rm command does not have an alias
unalias rm
# setup date and time variables for directory creation
BUD=`date +%b%d%Y`
echo "BackupDate="$BUD
DOW=`date +%a`
echo "Day of the Week="$DOW
echo "Backup Date="$BUD
echo ""
#
# remove old backup sets first - older than 3 days for now
# This happens only Tuesday-Saturday
# This will leave three days worth of backups online before the oldest ones get deleted
# Note: the find command syntax here is specific for RedHat AS2.1. This script concept
# was first used on AIX where the find command used the -prune argument
find /iiibackup/millennium/ -mtime +1 -type d -maxdepth 1 -exec rm -rf {} \;
## Set actual backup directory location
DBLOC="/iiibackup/millennium/$BUD"
echo "DBLOC="$DBLOC
#
## Check for todays date. If it exists, remove it and create a new one
if [ -d $DBLOC ] ; then
echo "Backup directory already exists, removing"
cd /iiibackup/millennium
rm -rf $BUD
else
echo "No duplicate found... continuing"
fi
#
## Create new directory and copy datafiles
echo "Creating backup directory for III Millennium"
mkdir $DBLOC
#
## Run the III commands to prepare for the backup
#
#
# The set notify only needs to happen once and is stored
# /usr/sbin/iiictl set notify me@company.com
/usr/sbin/iiictl get notify
/usr/sbin/iiictl backup prepare
prepare_val=$?
echo "Prepare Value="$prepare_val
if [ $prepare_val -eq 0 ]
then
cd /
tar cf - iiidb --exclude lost+found --exclude /iiidb/sockets | (cd $DBLOC; tar xBf -)
tar cf - iii --exclude lost+found | (cd $DBLOC; tar xBf -)
tar cf - iiiroot | (cd $DBLOC; tar xBf -)
/usr/sbin/iiictl backup success
success_val=$?
echo "Success Value="$success_val
if [ $success_val -neq 0 ]
then
mail -s "III Backup Success command Failed" me@company.com
fi
# /usr/sbin/iiictl log dump
else
/usr/sbin/iiictl backup fail
fail_val=$?
echo "Fail Value="$fail_val
if [ $fail_val -eq 0 ]
then
mail -s "III Backup Failed" me@company.com
fi
fi
#
echo "Backup completed at `date`"
You can give it any name of your choice, and place at any location that is accessible. In job settings you simply specify the location where the script is placed.
That can be configured both in UI and CLI (use --prejob parameter)
Yes, if it's just a standalone installation (i.e. not managed by VBR server), then you have to place the script file on the RHEL server. You can place it at any place of your choice, depending on your preferences and security policies in place.
OK. Say I place in the \etc\scripts folder. Where within the Veeam Console do I call the script? How would I reference that....\etc\scripts? I am not a linux person.
What are you trying to accomplish? I have to agree with @PTide that what you're trying to achieve is not clear.
Can you start from the beginning, i.e. is the machine you're trying to back up physical or virtual? Next, do you use Veeam? Etc.
Traditionally, any script you create is placed in the directory structure /usr/local/bin. When you want a script to run regularly then you create an entry in the crontab - I think though that Red Hat may employ a slightly different method of regularly running scripts.
If your copy of Red Hat OS is a paid for version then you should be able to find answers to some of your questions by logging into access.redhat.com
Otherwise, a search engine of your choice is a good friend.
The system in question is a physical server, NOT A VM, that is running RedHat Enterprise v7.5.
It is a Library Catalog system. The traditional backup is running with the Veeam Agent installed. The problem, simply, is that the logging service for the data that writes within the catalog, must be stopped before the actual data is copied. The script I posted above, needs to called, before the back process runs, to first stop the logging service, perform the backup job, and restart the logging service.
My question is, where does the script go on the Linux Server? How do I call that script from within the Veeam Configuration Job that is set up to back up that server?
MODE-1: Veeam Agent backup job managed by the backup server
The scripts are executed on the backup server.
MODE-2: Veeam Agent backup job managed by Veeam Agent
Veeam Backup & Replication will upload the script(s) to the /var/lib/veeam/scripts directory on each computer added to the configured Veeam Agent backup job. During the Veeam Agent backup job session, Veeam Agent for Linux will execute the script(s) on these computers
B) Veeam Agent backup job has been configured on the Linux server using local UI/CLI