Correction d'une script shell
ahmed_king29
Messages postés
39
Statut
Membre
-
dubcek Messages postés 18627 Date d'inscription Statut Contributeur Dernière intervention -
dubcek Messages postés 18627 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
Merci de m'aider :
Le principe est de chercher dans le contenu d'un fichier sous la forme " oraBackup'date '+%Y%m%d_0300''.log " de chercher la chaine de caractère "This backup (20120406_0800) session is completed and finished" s'il est existe affiche 1 sinon 0.
J'ai commencer par ce script :
DIR=/opt/oracle/admin/VSDB_S1/backuplogs
FILE=oraBackup'date '+%Y%m%d_0300''.log
if [ -e cat $DIR/$FILE | grep -w " This backup (20120406_0800) session is completed and finished" ]
then echo 1
else
echo 0
fi
Merci de corriger ce script.
Le contenu du fichier oraBackup'date '+%Y%m%d_0300''.log :
Investigating block corruption...
No block corruption reported...
Finalizing this backup session, going to sleep for 60 sec...
Unmounting backup disks...
Removing lockfile...
Setting correct directory permissions as a result of a potential Data Guard re-installation...
This backup (20120607_0300) session is completed and finished with 2 warning(s).
/etc/init.d/orawatch start... on vs1a
/etc/init.d/orawatch start... on vs1b
Merci de m'aider :
Le principe est de chercher dans le contenu d'un fichier sous la forme " oraBackup'date '+%Y%m%d_0300''.log " de chercher la chaine de caractère "This backup (20120406_0800) session is completed and finished" s'il est existe affiche 1 sinon 0.
J'ai commencer par ce script :
DIR=/opt/oracle/admin/VSDB_S1/backuplogs
FILE=oraBackup'date '+%Y%m%d_0300''.log
if [ -e cat $DIR/$FILE | grep -w " This backup (20120406_0800) session is completed and finished" ]
then echo 1
else
echo 0
fi
Merci de corriger ce script.
Le contenu du fichier oraBackup'date '+%Y%m%d_0300''.log :
Investigating block corruption...
No block corruption reported...
Finalizing this backup session, going to sleep for 60 sec...
Unmounting backup disks...
Removing lockfile...
Setting correct directory permissions as a result of a potential Data Guard re-installation...
This backup (20120607_0300) session is completed and finished with 2 warning(s).
/etc/init.d/orawatch start... on vs1a
/etc/init.d/orawatch start... on vs1b