You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
357 B

#!/bin/bash
# 备份日期
date_str=`date +%Y%m%d`
# 备份的文件名称
FILE=/usr/local/esBackup/es_backup_${date_str}.tar.gz
# 备份
rm -rf /usr/local/esBackup/es_backup*
tar zcvf $FILE /usr/local/esBackup/backup
# 切片
split -b 100m -d $FILE /usr/local/esBackup/es_backup_${date_str}.tar.gz.
# 删除原文件
rm -rf $FILE