当前位置: 技术问答>linux和unix
我又来了...如何以当天的日期生成日志文件???
来源: 互联网 发布时间:2015-12-13
本文导语: #!/bin/bash #this tool is check all mysql databases #write by yuan #write date 2006/09/09 set $CURDATE = date+%Y%m%d ##当天日期是这样赋值吗? if [$CRUDATE != '']; then /usr/local/mysql/bin/mysqlcheck --all-databases --check-only-changed -u root -p't...
#!/bin/bash
#this tool is check all mysql databases
#write by yuan
#write date 2006/09/09
set $CURDATE = date+%Y%m%d ##当天日期是这样赋值吗?
if [$CRUDATE != '']; then
/usr/local/mysql/bin/mysqlcheck --all-databases --check-only-changed -u root -p'test(@)b&$test' > /usr/local/mysql/checklog/$CURDATE ##这里可以直接跟变量吗?
fi
程序执行的结果怎么老是说'checklog is a directory'
|
#!/bin/bash
#this tool is check all mysql databases
#write by yuan
#write date 2006/09/09
set $CURDATE = date+%Y%m%d ##当天日期是这样赋值吗?
===> CURDATE=`date +%Y%m%d` `是数字1左边的那个键
if [$CRUDATE != '']; then
/usr/local/mysql/bin/mysqlcheck --all-databases --check-only-changed -u root -p'test(@)b&$test' > /usr/local/mysql/checklog/$CURDATE ##这里可以直接跟变量吗?
fi
#this tool is check all mysql databases
#write by yuan
#write date 2006/09/09
set $CURDATE = date+%Y%m%d ##当天日期是这样赋值吗?
===> CURDATE=`date +%Y%m%d` `是数字1左边的那个键
if [$CRUDATE != '']; then
/usr/local/mysql/bin/mysqlcheck --all-databases --check-only-changed -u root -p'test(@)b&$test' > /usr/local/mysql/checklog/$CURDATE ##这里可以直接跟变量吗?
fi