下面的代碼是用戶提交的,在使用的時候須要當心,由於 Atlassian 不提供這些代碼的技術支持。若是你在使用或者修改這些代碼的時候有任何問題,請粘貼到 post them to Atlassian Answers。java
這個腳本將會檢查備份文件而後刪除他們(必要的話),下面的代碼可能須要一些編輯。mysql
'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)
|
Old 的 XML 備份能夠經過天天晚上或者每週的自動運行腳本進行刪除。你也能夠在 cron 中設置類似的腳本:web
ls -t <path to your backup dir>/* | tail -n +
6
| xargs -i rm {}
|
或者,使用 tail
命令,若是你的系統不支持標準格式的話:sql
ls -t <path to your backup dir>/* | tail +
6
| xargs -i rm {}
|
Old 的 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 的 Home 目錄。bash
#!/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
|
https://www.cwiki.us/pages/viewpage.action?pageId=33004943eclipse