shell脚本汇总 1 以年月日命名备份文件
#!/bin/bash # create a back package for mysql of ball and web of ballcloud # # backup mysql for ball and web for ballcloud cd /www/web/backup_ballcloud/ year=`date +%Y ` month=`date +%m ` day=`date +%d ` now=$year-$month-$day #create a directory for every backup file mkdir backup_$now # tar /www/web/ballcloud/ /www/wdlinux/mysql/data/ tar -zcvf backup_$now/backup.tar.gz /www/wdlinux/mysql/data/ /www/web/ballcloud/ &> /dev/null
#
本文出自 “Frog的技术归档” 博客,请务必保留此出处http://frogtwo.blog.51cto.com/3805708/1937264
原文:http://frogtwo.blog.51cto.com/3805708/1937264