LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-26-2010, 12:42 AM   #1
arch12
LQ Newbie
 
Registered: Jul 2010
Posts: 5

Rep: Reputation: 0
need to check if the backup is sucessfulll from the file


channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 07-JUL-10
Recovery Manager complete.
RMAN BACKUP COMPLETED AT Wed Jul 7 02:07:12 EST 2010
START CREATE TAR FILE AT Wed Jul 7 02:07:12 EST 2010
START CLENUP OLD TAR FILE AT Wed Jul 7 02:08:05 EST 2010
CLEAN UP OLD TAR FILE FINISHED AT Wed Jul 7 02:08:05 EST 2010
execute backup transfer script... AT Wed Jul 7 02:08:05 EST 2010
Transferring /RMANBKUP/abc_db_20100707020712.tar with 2.6G /RMANBKUP/

1_db_20100707020712.tar to mcpnn01-public:/backup4/dailyapcalos/ap
cnn-RAC at Wed Jul 7 02:08:05 EST 2010...

i am trying to check if the backup is sucessfull or not
tail -30 /opt/ord22.log |awk '/backup set complete/'

how do i check the size of the backup?
 
Old 07-26-2010, 10:42 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,956

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by arch12 View Post
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 07-JUL-10
Recovery Manager complete.
RMAN BACKUP COMPLETED AT Wed Jul 7 02:07:12 EST 2010
START CREATE TAR FILE AT Wed Jul 7 02:07:12 EST 2010
START CLENUP OLD TAR FILE AT Wed Jul 7 02:08:05 EST 2010
CLEAN UP OLD TAR FILE FINISHED AT Wed Jul 7 02:08:05 EST 2010
execute backup transfer script... AT Wed Jul 7 02:08:05 EST 2010
Transferring /RMANBKUP/abc_db_20100707020712.tar with 2.6G /RMANBKUP/

1_db_20100707020712.tar to mcpnn01-public:/backup4/dailyapcalos/ap
cnn-RAC at Wed Jul 7 02:08:05 EST 2010...

i am trying to check if the backup is sucessfull or not
tail -30 /opt/ord22.log |awk '/backup set complete/'

how do i check the size of the backup?
How do you expect us to be able to tell you? You don't say how you're taking the backup, what backup media you're writing to, version/distro of Linux, or give any real details. You posted a snip of a log file, but say nothing about it, or its relevance to your problem.

Not sure why you're piping it to awk...do you mean grep, to look for the line?? What's in that log file? Are you looking for a shell script, command, what???
 
Old 07-26-2010, 10:49 AM   #3
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
Ditto TBOne's statements. What distro/version? What version of Oracle? What exactly have you done? What is breaking?

Judging from the minimal output you've posted; it appears you have a custom script that does an RMAN backup of an Oracle database.

A few questions/thoughts:

1. Do you understand the script that is taking this backup?

2. Do you understand what an RMAN backup is? Are you an OCP? If no to the previous two questions; you should not be trying to administer database backups for an Oracle database.

3. The easiest way to "test" your Oracle backup is to run a sandbox Oracle instance somewhere and use the RMAN CLI to restore your backup to that instance. Also your alert log on your instance will tell you if the backup has failed.

Taking into account that Oracle is very expensive software that comes with support; you should make use of that support.
 
Old 07-27-2010, 12:28 AM   #4
arch12
LQ Newbie
 
Registered: Jul 2010
Posts: 5

Original Poster
Rep: Reputation: 0
hi thanks for the replies but i have posted the sample of the backup log.all i need is from this part of the log i need to write a shell script...thats the reason why i am taking a backup set complete i would have posted the original log file exactly but some forums have rules not to post them.

i have highlighted in bold what i need to check from the file.the size should be greater than 2GB,i should i have backupset complete..

which means that the backup is succesfull.this is a part of the healthcheck script..
 
Old 07-27-2010, 10:17 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,956

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by arch12 View Post
hi thanks for the replies but i have posted the sample of the backup log.all i need is from this part of the log i need to write a shell script...thats the reason why i am taking a backup set complete i would have posted the original log file exactly but some forums have rules not to post them.

i have highlighted in bold what i need to check from the file.the size should be greater than 2GB,i should i have backupset complete..

which means that the backup is succesfull.this is a part of the healthcheck script..
Ok, so what you're wanting is a script to check the part where it says "2.6G", and report on the size?

We'll be glad to help you with a script, but we're not going to write it for you. As I said in my first post, you can use grep to check for what you need, then do whatever you'd like with the result. There are many bash scripting tutorials you can find via Google, that can get you going.
 
Old 07-27-2010, 04:52 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,398

Rep: Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207
At some point you have to test backups.
 
Old 07-27-2010, 07:38 PM   #7
arch12
LQ Newbie
 
Registered: Jul 2010
Posts: 5

Original Poster
Rep: Reputation: 0
[QUOTE=TB0ne;4046909]Ok, so what you're wanting is a script to check the part where it says "2.6G", and report on the size?

We'll be glad to help you with a script, but we're not going to write it for you. As I said in my first post, you can use grep to check for what you need, then do whatever you'd like with the result. There are many bash scripting tutorials you can find via Google, that can get you going.[/QUOTe

thanks i searched in google what i need is something like this

awk on this statement and if "backup set complete" is there than
{ check the size of the backup
if the backup size is greater than 2GB than
{ backup == successful
or else backup == not successful }

can you let me how can i use a grep in it
 
Old 07-28-2010, 11:00 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,956

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
[QUOTE=arch12;4047344]
Quote:
Originally Posted by TB0ne View Post
Ok, so what you're wanting is a script to check the part where it says "2.6G", and report on the size?

We'll be glad to help you with a script, but we're not going to write it for you. As I said in my first post, you can use grep to check for what you need, then do whatever you'd like with the result. There are many bash scripting tutorials you can find via Google, that can get you going.[/QUOTe

thanks i searched in google what i need is something like this

awk on this statement and if "backup set complete" is there than
{ check the size of the backup
if the backup size is greater than 2GB than
{ backup == successful
or else backup == not successful }

can you let me how can i use a grep in it
Grep does a search...check the man pages. So, feed in the log file, and look for something on the line that matches. If you find that line, use awk to grab the piece of the line you want. Then check it, and act.

Basic commands, based on your first post
Code:
$variable = `grep Transferring <your log file name> | awk {'print $4'} | sed 's/G//g'`
if ($variable > 2.0) then do something
You're finding the line with the size in the file, grabbing the part with the backup set size, then removing the G from it, so you can treat it as a number.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] gcc sanity check fails after restore tar backup welsh_frosty Linux - Software 2 07-03-2010 08:59 AM
backup laptop with rsync: online check unihiekka Linux - Newbie 4 01-01-2010 08:10 AM
Script to check a desktop is on before running backup? Charley the Cat Debian 4 08-20-2009 03:36 PM
Check long time process when backup b-RAM Linux - General 2 06-29-2009 09:17 AM
Error when attempting backup with File Backup lglrgl Linux - Software 0 08-03-2006 11:38 AM


All times are GMT -5. The time now is 11:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration