Sponsored Content
Full Discussion: Script for Export backup!!
Top Forums Shell Programming and Scripting Script for Export backup!! Post 302605212 by Mohammed Fareed on Wednesday 7th of March 2012 02:08:41 AM
Old 03-07-2012
MySQL Script for Export backup!!

Dear Team,

Can you please help me to write the script for export backup.
I've written some of the part and stuck in "if" condition Apprecatied if you help me.

Requirement:- Export backup completion sent the email if it is success (sent backup success email)or if fails (sent backup fails email).

My Shell Script:-
------------

Code:
######################### START OF SCRIPT #########################
#!/bin/bash
#Backup script by Export backup.
export HOST_NAME=`uname -n`
CDATE=`date +%d%m%Y`
export CDATE
echo $CDATE
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/10.2.0
ORACLE_SID=icba
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME PATH ORACLE_SID
ADMIN_EMAIL=xxxxx@email.id
LOGFILE=/home/oracle/dump/expdp_$CDATE.log
EXPORT_PATH=/home/oracle/dump/export_backup
DMP_FILE=expdp_$CDATE.dmp
LOG_FILE=expdp_$CDATE.log
export DMP_FILE LOG_FILE
echo Starting . > $LOGFILE
expdp system/password schemas=XXXXX directory=dump_dir DUMPFILE=$DMP_FILE LOGFILE=$LOG_FILE
#expdp mrmrs/mrmrs TABLES=resident,sejour DIRECTORY=EXPORT_BACKUP_DIR DUMPFILE=$DMP_FILE LOGFILE=$LOG_FILE
cat $EXPORT_PATH/$LOG_FILE >> $LOGFILE
echo Backup Completed. >> $LOGFILE
echo gzipping . >> $LOGFILE
gzip $EXPORT_PATH/$DMP_FILE >> $LOGFILE
echo gzipping Completed. >> $LOGFILE
#echo Deleting old files >> $LOGFILE
#find $EXPORT_PATH -type f -mtime +31 | xargs rm >> $LOGFILE
echo Delete Completed >> $LOGFILE
uuencode $LOGFILE expdb_$CDATE | mail -s "$HOST_NAME:$SID Export backup success on `CDATE`" $ADMIN_EMAIL
[oracle@testdb dump]$


Thank you,
Mohammed Fareed.

Last edited by Mohammed Fareed; 06-11-2012 at 07:39 AM..
Mohammed Fareed
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

export UNIX95=1 in a script??

Hi, I have following script. It has a line export UNIX95=1 What does UNIX95 suggest? If I donot export UNIX95=1 , I get error "illegale option -o" for ps command. man ps donot show -o option. Any pointers?? Thanks in advance, -Ashish (2 Replies)
Discussion started by: shriashishpatil
2 Replies

2. Shell Programming and Scripting

script to export variables

Hi, I am a newbie to unix as well as scripting. I need to write a script, which on execution sets the necessay oracle variables. Can someone help me out as to how to proceed? also can u suggest good tutorial for bash/shell scripting? thanks (1 Reply)
Discussion started by: aboxilica
1 Replies

3. UNIX for Dummies Questions & Answers

export script commands with xterm

I am attempting to write a shell script that runs a program which generates data and then runs another program to plot the data. The problem is that I need the plotting to take place in a different terminal window that stays open after the plotting has finished. I have experimented 'xterm -e '... (1 Reply)
Discussion started by: chris2051
1 Replies

4. Shell Programming and Scripting

How to export an array to perl script?

hi all...... i want to use an array ,declared in bash, in embedded perl script. is there any way to export whole array so that i can use it '$ENV{}' or something.. thanx in advance!! regards, prayush (1 Reply)
Discussion started by: tprayush
1 Replies

5. Shell Programming and Scripting

Use of export from a shell script..

Hi All, I am facing a problem while trying to export path variables from a script. Here's my situation 1. I have a script in which i have defined all the path variables to be exported: export ORACLE_HOME=/path/to/bin/ export NG_USER_HOME=/path/to/bin/ etc.... 2. I have another shell... (4 Replies)
Discussion started by: raghu_shekar
4 Replies

6. Shell Programming and Scripting

Export from perl script

Hi, Want to initaite the Oracle's Export utility from the perl script,but getting error as mentioned below: Script #!/usr/bin/perl -w my $username="system"; my $password = "manager"; my $tns = "DBLOCAL"; exp $username/$password@$tns Error $ ./testexp.pl Array found where... (4 Replies)
Discussion started by: milink
4 Replies

7. Shell Programming and Scripting

rsync backup mode(--backup) Are there any options to remove backup folders on successful deployment?

Hi Everyone, we are running rsync with --backup mode, Are there any rsync options to remove backup folders on successful deployment? Thanks in adv. (0 Replies)
Discussion started by: MVEERA
0 Replies

8. Shell Programming and Scripting

export repository shell script

Hi Forum, I have script to export he Siebel repository. My requirment is to have a shell script in place so when placed in it in a cron it should generate the repsoitory dat file on date basis. Script for export: repimexp /a E /c UCM_ES_DEV2_DSN /u sadmin /p SADMIN /d siebel /r... (4 Replies)
Discussion started by: nuthakki
4 Replies

9. 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

10. Shell Programming and Scripting

Export Error in Shell script

All, While executing the bellow commnad after the sed, awk command to export the value to, i am getting the fallowing error. line="_AABBB.EEEEEEE.LOG4JDISPLAY.PATH_=/apps/opt/abcde/pdstdsd/esapp/apadsfasdf/logadsfasdf.xml" keystring=`echo $line | awk -F"=" '{ print $1 }'`... (1 Reply)
Discussion started by: jothi basu
1 Replies
backintime-gnome(1)						   USER COMMANDS					       backintime-gnome(1)

NAME
backintime-gnome - a simple backup tool for Gnome. SYNOPSIS
backintime-gnome [ [--snapshots] path | --backup | --backup-job | --snapshots-path | --snapshots-list | --snapshots-list-path | --last-snapshot | --last-snapshot-path | --help | --version | --license ] DESCRIPTION
Back In Time is a simple backup tool for Linux. This is the Gnome version. For more information about Back In Time see backintime man page. If you want to run it as root you need to use 'gksu'. OPTIONS
path go directly to the specified file/folder -s, --snapshots show snapshots dialog for the specified path (only if there is no other dialog displayed) -b, --backup take a snapshot now (if needed) --backup-job take a snapshot (if needed) depending on schedule rules (used for cron jobs) --snapshots-path display path where is saves the snapshots (if configured) --snapshots-list display the list of snapshot IDs (if any) --snapshots-list-path display the paths to snapshots (if any) --last-snapshot display last snapshot ID (if any) --last-snapshot-path display the path to the last snapshot (if any) -h, --help display a short help -v, --version show version --license show license SEE ALSO
backintime, backintime-kde4. Back In Time also has a website: http://backintime.le-web.org AUTHOR
This manual page was written by BIT Team(<bit-team@lists.launchpad.net>). version 1.0.10 Mars 2009 backintime-gnome(1)
All times are GMT -4. The time now is 10:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy