понедельник, 1 марта 2010 г.

Oracle Application Incremental Backup FORMS and REPORTS

Full and Incremental Scripts

# List of directories you WANT to backup regularly...

DIRS is : /u02/oracle/pr/prappl/ont/11.5.0/reports
/u02/oracle/pr/prappl/ont/11.5.0/forms


# Using Month/Date for Backup Filenames

export dd=$(date +%Y%m%d)


# Simple Full Backup

> tar zcvf /Backup/Month_$dd.Full.tgz $DIRS


# Simple Incremental Backups

* Simple Daily Incremental Backup
find $DIRS -mtime -1 -type f -print | tar zcvf /Backup/Daily_$dd.tgz -T -

* Simple Weekly Incremental Backup
find $DIRS -mtime -7 -type f -print | tar zcvf /Backup/Weekly_$dd.tgz -T -

* Simple Monthly Incremental Backup
find $DIRS -mtime -31 -type f -print | tar zcvf /Backup/Month_$dd.tgz -T -

Example:

cat weekly_bak.sh

#!/bin/bash

export dd=$(date +%Y%m%d)
FORMS=/u02/oracle/pr/prappl/ont/11.5.0/forms
REPORTS=/u02/oracle/pr/prappl/ont/11.5.0/reports/
cd $FORMS
find -mtime -7 -type f -print | tar zcvf /home/applmgr/Bak/Week_Forms.$dd.tgz -T -

cd $REPORTS
find -mtime -7 -type f -print | tar zcvf /home/applmgr/Bak/Week_Reports.$dd.tgz -T -

Then add crontab task :

crontab -e

# Archiving changes in FORMS REPORTS directories
00 10 * * 5 /home/applmgr/scripts/weekly_bak.sh

Комментариев нет:

Отправить комментарий