Operating System - Linux
1828890 Members
2460 Online
109985 Solutions
New Discussion

Re: Backup graph file generation

 
SOLVED
Go to solution
BAUKnight
Frequent Advisor

Backup graph file generation

Dears,
I have oracle installed on HP UX machine

root@prodx/ >uname -a
HP-UX prodx B.11.11 U 9000/800 127414621 unlimited-user license

the oracle exports are taken to the directory

/oracle10g/export/

my export and backup scripts are stored in /home/oracle/scripts/

i am using this naming convention for my export files (dump and log)

daily : `date +%A`.dmp
weekly: `date +%y-%m-%B-%d-%a`.dmp
monthly: `date +%y-%m-%B`.dmp

I integrated the files to the fbackup script without any problems in my daily and weekly script, my question is for the monthly backup script

here what i am trying to do

rm m_graph
cd /oracle10g/export/
echo "`date +%y-%m-%B`.log" >> m_graph #monthly export log ilfe
echo "`date +%y-%m-%B`.dmp" >> m_graph #monthly export dump file
ls *Thu.* >> /home/oracle/scripts/m_graph #all weekly dump and log files

running the script as it is results in the following inside the m_graph file

08-04-April.log
08-04-April.dmp
08-03-March-06-Thu.dmp
08-03-March-06-Thu.log
08-03-March-13-Thu.dmp
08-03-March-13-Thu.log
08-03-March-20-Thu.dmp
08-03-March-20-Thu.log
08-03-March-27-Thu.dmp
08-03-March-27-Thu.log

these are the file i want to back them up, including the monthly and all last month weekly dump and log file, here is my backup command in the script

fbackup -0g /home/oracle/scripts/m_graph -f /dev/rmt/0m

but the problem is here

The backup graph must start each line with the i to include the line file or directory in the backup, but as you see i dont have the i option included, so my question is this

after i create the graph file, i want my script to add the following in each line

i /oracle10g/export/

how can i do this? this is urgent pls.

thx for any help offer.
3 REPLIES 3
Dennis Handly
Acclaimed Contributor
Solution

Re: Backup graph file generation

You can use the shell or awk:
while read file; do
echo "i /oracle10g/export/$file"
done < m_graph > m_graph.fixed
BAUKnight
Frequent Advisor

Re: Backup graph file generation

Denis,
i want to thank u for your fast reply, it helped in creating the need file.
i will test it and update the thread as needed.
thx again dennis
BAUKnight
Frequent Advisor

Re: Backup graph file generation

thank you alot dennis, this was very great issue.

thx again