当前位置: 技术问答>linux和unix
备份数据库的脚本用不了了,求助!
来源: 互联网 发布时间:2015-12-25
本文导语: 一个用了很长时间的脚本,最近重装后突然用不了了 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #!/bin/bash date=`date +'%F'` mysqldump -u root -ppwsd dbname > /backup/$date.dbname.sql +++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
一个用了很长时间的脚本,最近重装后突然用不了了
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#!/bin/bash
date=`date +'%F'`
mysqldump -u root -ppwsd dbname > /backup/$date.dbname.sql
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
这个脚本有错误麽?为什么执行不了?权限我已经修改过了
如果没有“date”就能备份成功
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
mysqldump -u root -ppwsd dbname > /backup/dbname.sql
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
OS:CentOS4.4
MYSQL:5.0.24a
大家帮忙看看吧
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#!/bin/bash
date=`date +'%F'`
mysqldump -u root -ppwsd dbname > /backup/$date.dbname.sql
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
这个脚本有错误麽?为什么执行不了?权限我已经修改过了
如果没有“date”就能备份成功
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
mysqldump -u root -ppwsd dbname > /backup/dbname.sql
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
OS:CentOS4.4
MYSQL:5.0.24a
大家帮忙看看吧
|
报什么错吗?
|
#!/bin/bash
SDATE=`date +'%F'`
mysqldump -u root -ppwsd dbname > /backup/$SDATE.dbname.sql
SDATE=`date +'%F'`
mysqldump -u root -ppwsd dbname > /backup/$SDATE.dbname.sql
|
直接在 shell 执行 date, 看是不是被其它路径的命令代替了?
|
是不是数据多了,就停在那边,你就多等一会嘛.
|
缺东西