S3的重复备份脚本在CentOS 5上失败



嗨,我无法使用本指南设置S3的备份:http://www.cenolan.com/2008/12/how-to-incremental-daily-backups-amazon-s3-duplicity/

运行脚本时出现以下错误:命令行错误:应为2个参数,实际为0在帮助屏幕中输入"duplicity-help"。

双面性日志文件:2013-08-07_17:43:20:。。。备份文件系统./duplicity backup:第60行:--include=/home:没有这样的文件或目录

我的脚本是这样的:

!/bin/bash
# Set up some variables for logging
LOGFILE="/var/log/backup.log"
DAILYLOGFILE="/var/log/backup.daily.log"
HOST='hostname'
DATE=`date +%Y-%m-%d`
MAILADDR="user@domain.com"
# Clear the old daily log file
cat /dev/null > ${DAILYLOGFILE}
# Trace function for logging, don't change this
trace () {
        stamp=`date +%Y-%m-%d_%H:%M:%S`
        echo "$stamp: $*" >> ${DAILYLOGFILE}
}
# Export some ENV variables so you don't have to type anything
export AWS_ACCESS_KEY_ID="xxxxx"
export AWS_SECRET_ACCESS_KEY="xxx"
export PASSPHRASE="xx"
# Your GPG key
GPG_KEY=xxxx
# How long to keep backups for
OLDER_THAN="1M"
# The source of your backup
SOURCE=/
# The destination
# Note that the bucket need not exist
# but does need to be unique amongst all
# Amazon S3 users. So, choose wisely.
DEST="s3+http://xxxx"
FULL=
if [ $(date +%d) -eq 1 ]; then
        FULL=full
fi;
trace "Backup for local filesystem started"
trace "... removing old backups"
duplicity remove-older-than ${OLDER_THAN} ${DEST} >> ${DAILYLOGFILE} 2>&1
trace "... backing up filesystem"
duplicity 
    ${FULL} 
    --encrypt-key=${GPG_KEY} 
    --sign-key=${GPG_KEY} 
    --volsize=250 
#    --include=/vhosts 
#    --include=/etc 
    --include=/home 
    --include=/root 
    --exclude=/** 
    ${SOURCE} ${DEST} >> ${DAILYLOGFILE} 2>&1
trace "Backup for local filesystem complete"
trace "------------------------------------"
# Send the daily log file by email
cat "$DAILYLOGFILE" | mail -s "Duplicity Backup Log for $HOST - $DATE" $MAILADDR
# Append the daily log file to the main log file
cat "$DAILYLOGFILE" >> $LOGFILE
# Reset the ENV variables. Don't need them sitting around
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export PASSPHRASE=

有人看到哪里出了问题吗?

您应该从脚本执行中删除注释行。发件人:

duplicity 
    ${FULL} 
    --encrypt-key=${GPG_KEY} 
    --sign-key=${GPG_KEY} 
    --volsize=250 
#    --include=/vhosts 
#    --include=/etc 
    --include=/home 
    --include=/root 
    --exclude=/** 
    ${SOURCE} ${DEST} >> ${DAILYLOGFILE} 2>&1

duplicity 
    ${FULL} 
    --encrypt-key=${GPG_KEY} 
    --sign-key=${GPG_KEY} 
    --volsize=250 
    --include=/home 
    --include=/root 
    --exclude=/** 
    ${SOURCE} ${DEST} >> ${DAILYLOGFILE} 2>&1

相关内容

  • 没有找到相关文章

最新更新