Re: script for ontake backup in multiple files
Posted in 2017
Why to multiple files?
Use 'ontpae -s -L $level -t STDIO > outfile' and save all the echo '0\\
\\
\\
....', mounting, touching, chmod'ing and chown'ing.
Could then split outfile if required - for whatever reason.
Could also compress outfile while creating: ... -t STDIO | gzip >
outfile.gz
Or take advantage of BACKUP_FILTER ...
Or use and take advantage of onbar with bundled PSM, Informix' own file
system based storage manager ...
HTH,
Andreas
From: "ABRAR RASHID" <mabrar@i2cinc.com>
To: ids@iiug.org
Date: 09/27/2017 08:04 PM
Subject: script for ontake backup in multiple files [39999]
Sent by: ids-bounces@iiug.org
Hi,
We need to take backup (ontape) in multiple files using bash script . we
are
using IDS12.10FC7.
currently we are using following script but it is not working properly.
1). Main script.
i=inst_name
level=0
.. /inst_name
TAP_FILE=`onstat -c|grep "^TAPEDEV" | awk '{print $2}'`
# mv $TAP_FILE $p_location
touch $TAP_FILE
chmod 660 $TAP_FILE
chown informix:informix $TAP_FILE
/bin/bash mount_tape $i $TAP_FILE &
echo '0\\
\\
\\
'|ontape -s -L $level
2). mount_tape
>mount.out
i=$1
TAP_FILE=$2
.. /$i
tape_size=`onstat -c |grep "^TAPESIZE"|awk '{print $2}'`
tape_size=`echo ${tape_size}*1024|bc`
echo "tape size=$tape_size">>mount.out
a=1
cnt=0
while [ $a -gt 0 ]; do
a=`onstat -g ath|grep ontape|wc -l`
file_size=`ls -l /u/ids_backup/data_test|awk '{print $5}'`
echo "file size=${file_size}" >>mount.out
if [ $file_size -eq $tape_size ]; then
echo $file_size >>mount.out
cnt=`expr $cnt + 1`
echo "cnt=${cnt}">>mount.out
echo " mv ${TAP_FILE} ${TAP_FILE}"_"${cnt}" >moun.out
mv ${TAP_FILE} ${TAP_FILE}"_"${cnt}
touch ${TAP_FILE}
chmod 660 ${TAP_FILE}
echo '\\
'
fi
done
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.