SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run -parts
DIRFILE=""$(date +%H%M.%Y%m%d)""
tar -czvf /z_data_back/info.k8.cn.pro.$DIRFILE.tar.gz /data/info.k8.cn 1>/z_data_back/log/info.pro.right.txt 2>>/z_data_back/log/info.pro.err.txt
tar -czvf /z_data_back/info.k8.cn.db.$DIRFILE.tar.gz /opt/lampp/var/mysql/info_ultrax 1>/z_data_back/log/info.db.right.txt 2>>/z_data_back/log/info.db.err.txt
删除10天之前的备份
#!/bin/bash:
myday=`date -d"10 day ago" +"%Y%m%d"`
/bin/rm -fr /z_data_back/*$myday*