Confluence 5.6 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
The information on this page does not apply to Confluence Cloud.
このスクリプトはバックアップファイル名を調べ、必要に応じて削除します。編集が必要となる場合があります。
'If you want 3 day old files to be deleted then insert 3 next to Date - "your number here"
'This script will search out and delete files with this string in them ".2005-12-04-" This of course depends on the number you enter.
'You can always do a wscript.echo strYesterday or strFileName to see what the script thinks you are searching for.
dtmYesterday = Date - 3
strYear = Year(dtmYesterday)
strMonth = Month(dtmYesterday)
If Len(strMonth) = 1 Then
strMonth = "0" & strMonth
End If
strDay = Day(dtmYesterday)
If Len(strDay) = 1 Then
strDay = "0" & strDay
End If
strYesterday = strYear & "-" & strMonth & "-" & strDay
strFileName = "C:\test*." & strYesterday &"-*"
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile(strFileName)
夜間や週次自動スクリプト、または以下のような cron を挿入することで、古い XML バックアップは自動的に削除される場合があります。
ls -t <path to your backup dir>/* | tail -n +6 | xargs -i rm {}
ご利用のシステムが標準形式をサポートしていない場合、tail コマンドの古い形式を使用します。
ls -t <path to your backup dir>/* | tail +6 | xargs -i rm {}
夜間や週次自動スクリプト、または以下のような cron を挿入することで、古い XML バックアップは自動的に削除される場合があります。サイトの適切な値 BACKUP_DIR と DAYS_TO_RETAIN 変数を設定します。実行の間、DAYS_TO_RETAIN より多くのファイルが作成されます。
#!/bin/sh # Script to remove the older Confluence backup files. # Currently we retain at least the last two weeks worth # of backup files in order to restore if needed. BACKUP_DIR="/data/web/confluence/backups" DAYS_TO_RETAIN=14 find $BACKUP_DIR -maxdepth 1 -type f -ctime +$DAYS_TO_RETAIN -delete
mySQL データベースと Confluence ホーム ディレクトリのバックアップを作成します。
#!/bin/bash CNFL=/var/confluence CNFL_BACKUP=/backup/cnflBackup/`date +%Y%m%d-%H%M%S` rm -rf $CNFL/temp/* mkdir $CNFL_BACKUP mysqldump -uroot -p<password> confluence|gzip > $CNFL_BACKUP/confluence.mysql.data.gz tar -cjvf $CNFL_BACKUP/data.bzip $CNFL > $CNFL_BACKUP/homedir.status
export d=`date +%u` mkdir -p /home/backup/postgres/$d sudo -u postgres pg_dumpall | bzip2 > /home/backup/postgres/$d/sql.bz2