whughesiii
MIS
Greetings all,
I have a bat file that I use to make a backup of an SQLexpress database. The backup is done to a local disk. I then initiate a move command to move the files to a shared folder on another system. For some reason when running it via a scheduled task, the move command either doesn't run or cannot move for one reason or another. Below is my script, any help is appreciated.
I have a bat file that I use to make a backup of an SQLexpress database. The backup is done to a local disk. I then initiate a move command to move the files to a shared folder on another system. For some reason when running it via a scheduled task, the move command either doesn't run or cannot move for one reason or another. Below is my script, any help is appreciated.
Code:
@ECHO OFF
echo %date% >> "C:\batch files\script.log"
net use Z: /DELETE >> "c:\batch files\script.log"
net use z: \\san-proxy\SQL_Backups\mtg-svr >> "c:\batch files\script.log"
REM forfiles /p "Z:\" /m *.BAK /d -2 /c "cmd /c DEL @file"
sqlcmd -E -Q "EXEC sp_BackupDatabases @backupLocation='D:\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\', @backupType='F'" >> "C:\batch files\script.log"
move "D:\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\*.BAK" z:\ >> "C:\batch files\script.log"
echo %date% >> "C:\batch files\script.log"
echo "C:\batch files\script.log"
:echo "C:\batch files\script.log"