做duplicate總是報錯,因為時間點找不好。想多保留一天的備份但乙個檔案系統放不下兩天的備份檔案。寫乙個指令碼來完成這個需求。指令碼如下:
$ more /global/oracle/orahome1/local/scripts/mv_backups_to_new.sh
# /usr/bin/ksh
# modified by henry on july 10,2008
# move older backup files to new place
cd /global/oracle/oradump1/arsprd/backup/
/usr/bin/find . -type f -mtime +2 | sed 's/^..//g' >/global/oracle/orahome1/local/scripts/files_to_mv
#exec 4< /global/oracle/orahome1/local/scripts/files_to_rm
#while read -u4 rec
#do#if (( $ == 0 )); then
# continue
# fi
#cd /global/oracle/oradump1/arsprd/backup/
#rm -f $(print $rec)
#cd /global/oracle/oradump2/arsprd/backup
#rm -f $(print $rec)
#done
exec 4< /global/oracle/orahome1/local/scripts/files_to_mv
##mv each file listed in the files_to_mv file
#while read -u4 rec
do## exit if not records in oratab
if (( $ == 0 )); then
continue
fi## mv it
#mv and ln it.
cd /global/oracle/oradump1/arsprd/backup/
mv $(print $rec) /global/oracle/oradump2/arsprd/backup
# echo "cat /global/oracle/orahome1/local/scripts/files_to_mv|sed 's///global//oracle3//oradump//arsprd//backupglobal//oracle/
/oradump2//arsprd//backup/'|ln -s /global/oracle/oradump2/arsprd/backup/$(print $rec)"
cat /global/oracle/orahome1/local/scripts/files_to_mv|ln -s /global/oracle/oradump2/arsprd/backup/$(print $rec)
# ln -s sed 's//$(print /$rec)/global//oracle//oradump2//arsprd//backup/' $(print $rec)
cp /global/oracle/orahome1/local/scripts/files_to_mv /global/oracle/orahome1/local/scripts/files_to_rm
done
寫乙個指令碼來移動RMAN備件檔案的位置。
做duplicate總是報錯,因為時間點找不好。想多保留一天的備份但乙個檔案系統放不下兩天的備份檔案。寫乙個指令碼來完成這個需求。指令碼如下 more global oracle orahome1 local scripts mv backups to new.sh usr bin ksh modi...
寫乙個指令碼來驗證域控之間資訊同步的時間間隔
修改description這個屬性,在兩台域控上觀察這個屬性變化的時間戳。順便搞搞清楚兩種迴圈的區別,dountil是條件滿足才終止,dowhile是條件不滿足即終止。do.until寫法 set aduser server corp dc5 was identity cn name1,ou use...
寫乙個檔案備份指令碼
今天乙個意外,我寫的大半個月的日記加密檔案受損,無法恢復。於是決定寫乙個專用備份的指令碼檔案。主要思想就是在當前目錄backup 下根據當天的日期建立乙個資料夾,然後將檔案複製到該資料夾下。windows版的如下 echo off echo 開始備份日誌檔案 set ymd date 0,4 dat...