Computer Hope

Microsoft => Microsoft DOS => Topic started by: paul.wiggers on July 27, 2017, 10:04:45 AM

Title: How To Move Then Delete SQL Dump File
Post by: paul.wiggers on July 27, 2017, 10:04:45 AM
I am trying to use a batch script to move a SQL dump from 1 server to a different one. The script I'm using will create the file and copy it but when I try using the MOVE command it only creates the file. I've included the script below, any thoughts on how I can do this?

@ECHO OFF

set TIMESTAMP=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%

REM Export all databases into file C:\DB Backups\backup\docuware.[year][month][day].sql
"C:\Program Files (x86)\DocuWare\Internal Database V2\bin\mysqldump.exe" --all-databases --result-file="C:\DB Backups\docuware.%TIMESTAMP%.sql" --user=admin --password=xxxxxxxx

REM Change working directory to the location of the DB dump file.
C:
CD \DB Backups

COPY "C:\DB Backups\" "E:\DW_PROD\Database Backups\



Title: Re: How To Move Then Delete SQL Dump File
Post by: patio on April 27, 2019, 09:05:28 AM
He hasn't been back in almost 2 years...
Title: Re: How To Move Then Delete SQL Dump File
Post by: Blisk on May 14, 2019, 02:24:45 AM
Why you need a script to move file.
use robocopy it has many options to do that.