Hello All,
Plase your additional input will be "YUGELLY" appreciated
Requirements:
1) On the first day of each month, zip and create a tar file from existing *aud files.
2) On everyday thereafter, compress new *aud files and append it to the to the existing tar file created in (1).
#!/bin/ksh
#ScriptName:copy_zip_tar.sh
#SetInter-FieldSeparatortocolon.Simplifiesparsingtheinputfile.
IFS=:
cat/etc/oratab|whilereadORA_SIDORA_HOMEORA_START
fmonth=`date'+%d'`
if[$fmonth==01]
do
#find/orahome/app/oracle/admin/${ORA_SID}/adump-mtime+7-execrm{}\;
#candothefollowingfortesting...
find/orahome/app/oracle/admin/${ORA_SID}/adump/*-mtime+7-ls
tar cvf-/orahome/app/oracle/admin/${ORA_SID}/adump/*aud|gzip-c > ${ORA_SID}_aud_files_$(date'+%Y%m%d').tar.gz
else
tar cvf-/orahome/app/oracle/admin/${ORA_SID}/adump/*aud|gzip-c > /orahome/app/oracle/admin/${ORA_SID}/adump/{ORA_SID}_aud_files_$(date'+%B%Y').tar.gz
done
exit
Plase your additional input will be "YUGELLY" appreciated
Requirements:
1) On the first day of each month, zip and create a tar file from existing *aud files.
2) On everyday thereafter, compress new *aud files and append it to the to the existing tar file created in (1).
#!/bin/ksh
#ScriptName:copy_zip_tar.sh
#SetInter-FieldSeparatortocolon.Simplifiesparsingtheinputfile.
IFS=:
cat/etc/oratab|whilereadORA_SIDORA_HOMEORA_START
fmonth=`date'+%d'`
if[$fmonth==01]
do
#find/orahome/app/oracle/admin/${ORA_SID}/adump-mtime+7-execrm{}\;
#candothefollowingfortesting...
find/orahome/app/oracle/admin/${ORA_SID}/adump/*-mtime+7-ls
tar cvf-/orahome/app/oracle/admin/${ORA_SID}/adump/*aud|gzip-c > ${ORA_SID}_aud_files_$(date'+%Y%m%d').tar.gz
else
tar cvf-/orahome/app/oracle/admin/${ORA_SID}/adump/*aud|gzip-c > /orahome/app/oracle/admin/${ORA_SID}/adump/{ORA_SID}_aud_files_$(date'+%B%Y').tar.gz
done
exit