#!/bin/sh LOG=/var/log/mysql-backup.log # mysql db info USER_ROOT=XXXXXX USER_PWD=XXXXXXX # mysql data stored dir TODAY=`date +%F` STOREDIR=/mnt/tf-card/mysql-back/$TODAY mkdir $STOREDIR echo "*** PATH:$STOREDIR mysql-backup ***" >> $LOG #
-----sql脚本 declare @fileName varchar(255) ,--定义备份文件名变量 @dbname varchar(255)--定义备份数据库名变量declare mycursor cursor fast_forward for select name from master..sysDatabases order by name --定义一个游标对象 open mycursor --打开游标set @dbname='pysf'set @fileName