SQWareProduction:mssql:lib:sqwmsq RestoreDatabase.lib

From Wiki_dbSQWare
Revision as of 19:36, 14 July 2010 by Exploit (talk | contribs) (Updated by Expdbtools)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Librairie de fonctions shell $gvsqw_MssBin/../lib/sqwmsq_RestoreDatabase.lib:
lib for sqwmsq_RestoreDatabase.ksh
cat $gvsqw_TmpFile.fic|grep dump|grep "${lfsqw_DatabaseSource}_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9]_"|awk '{print $NF}'> $gvsqw_TmpFile echo "No backup of ${lfsqw_DatabaseSource} found on \\$lvsqw_BckDir" |tee -a $gvsqw_TmpFile.mail echo "No file like ${lfsqw_DatabaseSource}_$lvsqw_BckDate_*\${TYPE}*.dump\n" |tee -a $gvsqw_TmpFile.mail echo "No file like ${lfsqw_DatabaseSource}_\$lvsqw_BckDate_*\${TYPE}*.dump\n" |tee -a $gvsqw_TmpFile.mail echo "search file $lfsqw_FileName" echo "xp_cmdshell 'dir \\$lvsqw_BckDir\\${lfsqw_DatabaseSource}*.dump'\ngo" >$gvsqw_TmpFile FIC=`cat $gvsqw_TmpFile|grep "${lfsqw_DatabaseSource}_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9]_fstripe1_" | tail -1 | sed 's/fstripe..*/fstripe/'` FIC=`cat $gvsqw_TmpFile|grep "${lfsqw_DatabaseSource}_${lvsqw_BckDate}_fstripe1_" | tail -1 | sed 's/fstripe..*/fstripe/'` FIC=`cat $gvsqw_TmpFile|grep $lfsqw_FileName | tail -1 | sed 's/fstripe..*/fstripe/'` gfsqw_ExecSql $gvsqw_TmpFile > $gvsqw_TmpFile.fic if [ $grep -c ${lfsqw_DatabaseSource} $gvsqw_TmpFile -ne 0 ] if [ ! -z "$lfsqw_FileName" ] if [ ! -z "$lfsqw_SubDir" ] lfsqw_GenerateSql lfsqw_GetShared lfsqw_ListBck lfsqw_RepeatSubDir="" lfsqw_RepeatSubDir="-SR '$lfsqw_SubDir' " lvsqw_BckDir="\\\\${lvsqw_InstanceParam}\\${lvsqw_SharedDirectory}\\\\${lfsqw_SubDir}\\"

Nuvola apps information.png
Note:
You can overload functions contained in $gvsqw_MssBin/../lib/sqwmsq_RestoreDatabase.lib

by function with same name in $gvsqw_MssBin/../lib_cust/sqwmsq_RestoreDatabase.lib for all your environnement
or by $HOME/sqwConfig/sqwmsq_RestoreDatabase.lib specifically for this user .