备份的脚本

#!/bin/bash
# CUR_PATH
CUR_PATH=$(cd `dirname $0`; pwd)
# BACKUP_PATH
BACKUP_BASE_PATH=/data/backup
DATETIME=`date +%Y%m%d%H%M%S`
BACKUP_PATH=${BACKUP_BASE_PATH}/${DATETIME}

`mkdir -p ${BACKUP_PATH}`

#copy
`cp -a ${CUR_PATH}/sleeve-3.0-SNAPSHOT.jar ${BACKUP_PATH}`
`cp -a ${CUR_PATH}/WEB-INF/lib/sleeve-app-3.0-SNAPSHOT.jar ${BACKUP_PATH}`

你可能感兴趣的:(运维)