#!/bin/bash

BACKUP_BASE=/opt
BUCKET_NAME=eDoc2

BACKUP_PATH="${BACKUP_BASE}/eDoc2"

if [ ! -d "${BACKUP_PATH}" ];then
    mkdir -p ${BACKUP_PATH}
fi

/usr/bin/s3cmd sync s3://eDoc2/ ${BACKUP_PATH}/ 
if [ "$?" == 0 ];then
    echo "$(date '+%Y-%m-%d %H:%M:%S') Document backup success." >> /tmp/edoc2_backup.log
else
    echo "$(date '+%Y-%m-%d %H:%M:%S') Document backup faile." >> /tmp/edoc2_backup.log
fi

