Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How To Move Then Delete SQL Dump File  (Read 5368 times)

0 Members and 1 Guest are viewing this topic.

paul.wiggers

    Topic Starter


    Newbie

    • Experience: Experienced
    • OS: Unknown
    How To Move Then Delete SQL Dump File
    « 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\




    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: How To Move Then Delete SQL Dump File
    « Reply #1 on: April 27, 2019, 09:05:28 AM »
    He hasn't been back in almost 2 years...
    " Anyone who goes to a psychiatrist should have his head examined. "

    Blisk



      Intermediate

      Thanked: 1
      • Experience: Familiar
      • OS: Windows 7
      Re: How To Move Then Delete SQL Dump File
      « Reply #2 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.