Bat脚本备份sqlserver 表结构.存储过程.指定表数据: @echo off cd /d %~dp0 ::备份表结构.存储过程和部分配置表的数据 set LogFile=report.log set servername="192.168.43.9" set DBname="TEST" set User="sa" set Password="123456*" echo Deployed Time: %date% %ti…
#!/bin/bash #this is a script of mysql backup if [ ! -d /mydata/data1/backup ] ;then mkdir /mydata/data1/backup fi cd /mydata/data1/backup | grep .*all.sql) #查找7天内是否有备份的文件 echo $file if [ -z $file ] ;then echo "backup all databases..." backupfil…
#!/bin/bash #this is a script of mysql backup #Mysql="mysql" #MysqlDump="mysqldump" Host="192.168.1.101" Port=" User="root" PassWord="******" DataBaseName="test" path=/home/luffy/mydata/back…
提示原因是数据库名字有中横岗“-” 解决方法:用中括号把名字括起来就可以了 call :backupone [数据库名-new] 完整备份脚本如下 @ECHO ON set DATE=%date:/=-% set bakupfolder=F:\bakup\ rem 1按子目录保存备份文件;0不按 set lay_in_subfolder=1 call :backupone [数据库名-new] goto :EOF @ECHO OFF :backupone setlocal echo %1 set…