script to verify backup is succesfull or not


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script to verify backup is succesfull or not
# 1  
Old 07-22-2010
script to verify backup is succesfull or not

Code:
tail -30 /opt/oracle/rmanbkup/log/db_backup_JONDB.log
input datafile fno=00005 name=+ORA_DATA/jondb/datafile/users.264.696728295
input datafile fno=00003 name=+ORA_DATA/jondb/datafile/sysaux.261.696728281
input datafile fno=00001 name=+ORA_DATA/jondb/datafile/system.259.696728257
input datafile fno=00002 name=+ORA_DATA/jondb/datafile/undotbs1.260.696728279
input datafile fno=00004 name=+ORA_DATA/jondb/datafile/undotbs2.263.696728293
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 22-JUL-10
 
Recovery Manager complete.
RMAN BACKUP COMPLETED AT  Thu Jul 22 02:07:12 EST 2010
START CREATE TAR FILE AT  Thu Jul 22 02:07:12 EST 2010
START CLENUP OLD TAR FILE AT  Thu Jul 22 02:08:04 EST 2010
CLEAN UP OLD TAR FILE FINISHED AT  Thu Jul 22 02:08:04 EST 2010
execute backup transfer script... AT  Thu Jul 22 02:08:04 EST 2010
Transferring /RMANBKUP/apcnn01_JONDB_20100721020718.tar with  2.8G      /RMANBKUP/apcnn01_JONDB_20100721020718.tar to mcpnn01-public:/backup4/dailyapcalos/apcnn-RAC at Thu Jul 22 02:08:04 EST 2010...

I need to verify if the backup was success full or not can anyone give me idea how to write it.

Code:
tail -30 /opt/oracle/rmanbkup/log/db_backup_JONDB.log | awk -F ":" , { if backup set complete }'

Moderator's Comments:
Mod Comment Use code tags please.
# 2  
Old 07-22-2010
I can not clearly see from the log how you decide if the backup was completely successful.
You could grep if you have any pattern like "fail" or "error" in the log. If yes, then send a mail or whatever.

Example:
Code:
grep -qiE "fail|error|incompl" your.log > /dev/null 2>&1 && echo "Sir, we have encountered a problem with the backup, sir." | mail -s "Backup failed" you@somedom.org

# 3  
Old 07-22-2010
Code:
tail -30 /opt/oracle/rmanbkup/log/db_backup_JONDB.log |awk '/backup set complete/'

# 4  
Old 07-22-2010
Code:
tail -30 /opt/oracle/rmanbkup/log/db_backup_JONDB.log |awk '/backup set complete/'

should i use a if statement here awk '/backupset complete/' if ( how do i puit Gb in here)

Moderator's Comments:
Mod Comment Use code tags, ty.

Last edited by zaxxon; 07-22-2010 at 05:19 AM..
# 5  
Old 07-22-2010
Code:
# if [[ `tail -30 /opt/oracle/rmanbkup/log/db_backup_JONDB.log  | grep -w "backup set complete"` ]] ; then  
                   echo "Backup Complete"; 
              else 
                  echo "Backup Not Complete"; 
              fi
Backup Complete


Last edited by ygemici; 07-22-2010 at 04:19 AM..
# 6  
Old 07-22-2010
Quote:
Originally Posted by arch12
tail -30 /opt/oracle/rmanbkup/log/db_backup_JONDB.log |awk '/backup set complete/'

should i use a if statement here awk '/backupset complete/' if ( how do i puit Gb in here)
awk '/backup set complete/' will output the line with "backup set complete", same as :

Code:
grep "backup set complete" urfile

# 7  
Old 07-23-2010
sorry and thanks will use code tags from the next post i put in but anyway i didnt past exactly same messages from the server.

---------- Post updated at 07:50 PM ---------- Previous update was at 07:08 PM ----------

i need to even check the backup size how do it should be greater thar 2 do i awk

---------- Post updated at 07:50 PM ---------- Previous update was at 07:50 PM ----------

---------- Post updated 07-23-10 at 12:32 AM ---------- Previous update was 07-22-10 at 07:50 PM ----------

thank you for the prompt replies but i want to very two things in the above file and say that the backup is complete.one is size >2,other one is backup set complete how can i verify from the log above.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script that verify output after make

Hi I write below script to show if expected file exist in /etc/library/ , print success else failed. But it will print full path I just need to print module name in output. And if it possible show time that spent to compile each module. FYI 1: First run another script just go to the paths... (1 Reply)
Discussion started by: indeed_1
1 Replies

2. Shell Programming and Scripting

Perl script to verify that a value is present in an array (list)

I have 2 files , i need compare both files field by field, and in the fourth field some value will be interchaged and some value will be **. ex: file1 john|0.0|4|**:25;JP:50;UY:25 file2 john|0.0|4|JP:50;**:25;UY:25 (4 Replies)
Discussion started by: veeruasu
4 Replies

3. UNIX for Advanced & Expert Users

Script to verify veritas mirror

Hi Experts, I have lot of Solaris servers and in most of them, root disk is mirrored in rootdg. I just want to check all servers, if there is any server whose root disk is not mirrored. Either it may be with detached plexes or not mirrored at all. I can run a for loop for all servers. Can... (4 Replies)
Discussion started by: solaris_1977
4 Replies

4. Shell Programming and Scripting

DNS circular verify script

I have modified a script to do a circular DNS look up. The theory is this for a given subnet build a range if IP's do a reverse look up on those IP's take the output of the reverse look up then and do a forward look up If the returns match up give a good status If not return a fail... (1 Reply)
Discussion started by: snoman1
1 Replies

5. Shell Programming and Scripting

Help with Backup Shell Script for Network Device Configuration backup

HI all, im new to shell scripting. need your guidence for my script. i wrote one script and is attached here Im explaining the requirement of script. AIM: Shell script to run automatically as per scheduled and backup few network devices configurations. Script will contain a set of commands... (4 Replies)
Discussion started by: saichand1985
4 Replies

6. UNIX for Advanced & Expert Users

Verify file was sftp'd via bash script

Hello Experts, I have a script that that transfers a file (via sftp) and it works fine but we ran into a snag where the target server asked for the ssh key and the script didn't know what to do. I want to add some logic to this script that at least sends an email that it didn't complete as... (4 Replies)
Discussion started by: Tiberius777
4 Replies

7. AIX

Backup with Pax command. How to verify tape?

Dear all experts online, In my environment of AIX 5300-07, I am currently using "pax" command to backup all filesystems that I need to backup and it will take me around 4 hours time with LTO3 tape drive. When I need to verify the tape after backup, I am using "pax" command to list all files in... (2 Replies)
Discussion started by: kwliew999
2 Replies

8. UNIX for Dummies Questions & Answers

Verify a flat file with UNIX function or script.

I re-post my question to seek your help and critique. I was required to verify a very large and tab-delimited file, named 'MyFile'. 1. The each line in 'MyFile' has 7 columns, and that the values in the 5th column are integers. I need to use shell functions (and standard LINUX/UNIX filters) to... (1 Reply)
Discussion started by: duke0001
1 Replies

9. Shell Programming and Scripting

Help needed with script to verify the version of BIND

I have tried thought of using instfix -ivqc | grep BIND , but this did not return the result I was looking for; it seem to list out the the different patches that had been applied to BIND. I'm actually looking for overall version, like you'd get when checking the OS level for instance. (1 Reply)
Discussion started by: sport
1 Replies

10. Shell Programming and Scripting

Script to verify SSH is running

Writing a simple test script that looks for ssh, kills if its running and verifies if its still running. If it isn't, move on. My issue, its cause I don't know how, is to verify if ssh is running still. Also, is there a way have this do this on a remote server? I already have the ssh keys... (7 Replies)
Discussion started by: djinn
7 Replies
Login or Register to Ask a Question