At work, a small hard drive on a backup PC is filling up. If it does fill up, our Mircros database will fail to sync between the main server and the backup server. I found an SQL Backup folder that seems to be taking up most of our drive space. We've been moving that data to another server (temporary fix) on a daily basis. I sat down at my desk today thinking I'd write a batch file to automate the process, but it isn't happening. When the program runs, I get an error message stating - "File Not Found". I'm hoping someone can look at the following code and pin point my problem.
@echo off
TITLE SPACE SAVER
REM
REM THIS PROGRAM MOVES DATA FROM AN SQL BACKUP FOLDER TO ANOTHER SERVER TO FREE UP
REM SPACE ON THIS HARD DRIVE. IF THIS HARD DRIVE IS FULL, THE MICROS DATABASE WILL
REM NOT SYNC BETWEEN THE PRIMARY AND BACKUP SERVERS.
REM
REM WRITTEN 09/01/06
REM
REM
REM WRITTEN BY @@@@@@@@@@@@@@
REM
REM
REM COPY DATA TO THE BACKUP DOMAIN CONTROLLER
CLS
ECHO COPY DATA TO THE BACKUP DOMAIN CONTROLLER - WORKING....
ECHO DELETE ORIGINAL BACKUP FILES TO FREE DISK SPACE - IN QUEUE
COPY D:\PROGRAM FILES\Microsoft SQL Server\MSSQL\Backup\*.* X:\BACKUP\*.* /Y
REM
REM
REM DATA IS COPIED...DELETE THE ORIGINAL FILE
CLS
ECHO COPY DATA TO THE BACKUP DOMAIN CONTROLLER - COMPLETE
ECHO DELETE ORIGINAL BACKUP FILES TO FREE DISK SPACE - WORKING....
DEL D:\PROGRAM FILES\Microsoft SQL Server\MSSQL\Backup\*.*
REM
REM
REM DATA HAS BEEN MOVED TO THE BACKUP DOMAIN CONTROLLER. EXIT PROGRAM.
cls
ECHO COPY DATA TO THE BACKUP DOMAIN CONTROLLER - COMPLETE
ECHO DELETE ORIGINAL BACKUP FILES TO FREE DISK SPACE - COMPLETE
EXIT
The folder is indeed on the "D" drive and the destination folder has been mapped to as an "X" drive. Any and all information will be greatly appreciated.
Thanks,
Magus