Running robocopy after backup.

User discussion and information resource forum for TeraByte Drive Image products, including TBNetManage.
Post Reply
Ethereal
Posts: 6
Joined: Sat May 18, 2013 3:30 pm

Running robocopy after backup.

Post by Ethereal »

hello - thank you for reading my post.

I have a batch file which works, making an image of my system disc to my backup drive.

start "" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\imagew64.exe" /b /d:w1 /f:"B:\Image For Windows Test\Backup-w1-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /vb /comp:2 /purge:-7 /desc:"Oct-Core System Disc"

This line works mirroring the folder to a secondary location -

robocopy "B:\Image For Windows Test" "\\freenas\Working\Image For Windows Test" /mir

The commands can be run correctly separately. When they are both in the same batch file the backup works but the mirror doesn't - the windows closes instantly.
Hopefully someone can help - basically i want a batch file to backup my drive and when this is finished - mirror to the secondary location. This is my attempt so far-

start "" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\imagew64.exe" /b /d:w1 /f:"B:\Image For Windows Test\Backup-w1-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /vb /comp:2 /purge:-7 /desc:"Oct-Core System Disc"

robocopy "B:\Image For Windows Test" "\\freenas\Working\Image For Windows Test" /mir
TAC109
Posts: 278
Joined: Tue Sep 06, 2011 10:41 pm

Re: Running robocopy after backup.

Post by TAC109 »

The 'start' command should use the /w parameter so that it waits until the imaging has completed.
Ethereal
Posts: 6
Joined: Sat May 18, 2013 3:30 pm

Re: Running robocopy after backup.

Post by Ethereal »

i tried /w this gave an invalid parameter /w

i tried /wait and when i ran

start "" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\imagew64.exe" /b /d:w1 /f:"B:\Image For Windows Test\Backup-w1-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /wait /vb /comp:2 /purge:-7 /desc:"Oct-Core System Disc"

robocopy "B:\Image For Windows Test" "\\freenas\Working\Image For Windows Test" /mir

this batch file is starting the backup and instantly the robocopy window before the backup finishes

thank you for your reply
TAC109
Posts: 278
Joined: Tue Sep 06, 2011 10:41 pm

Re: Running robocopy after backup.

Post by TAC109 »

The /w (or /wait) parameter is for the 'start' command, so it should be placed immediately after 'start' (with an intervening space).
Ethereal
Posts: 6
Joined: Sat May 18, 2013 3:30 pm

Re: Running robocopy after backup.

Post by Ethereal »

that's working now - thank you very much :-)
AlanD
Posts: 215
Joined: Sat Sep 17, 2011 4:45 pm

Re: Running robocopy after backup.

Post by AlanD »

On 2016-11-19 5:15 PM, Ethereal wrote:
> i tried /w this gave an invalid parameter /w
>
> i tried /wait and when i ran
>
> start "" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\imagew64.exe" /b /d:w1 /f:"B:\Image For Windows Test\Backup-w1-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /wait /vb /comp:2 /purge:-7 /desc:"Oct-Core System Disc"
>
> robocopy "B:\Image For Windows Test" "\\freenas\Working\Image For Windows Test" /mir
>
> this batch file is starting the backup and instantly the robocopy window before the backup finishes
>
> thank you for your reply
>
>
FYI, this reliably works for me:

SET PATH1=C:\PROGRA~1\TERABY~1\IMAGEF~1\V2\imagew.exe
SET PATH2=D:\PURGE
SET PATH3=U:\PURGE
SET PATH4=C:\Windows\System32\Robocopy.exe

"%PATH1%" /b /d:#0xCF554A0C
/f:"#0x800A0F72@0x1:\PURGE\$~YYYY$-$~MM$-$~DD$" /logl:10 /comp:14 /v
/purge:-2 /uy

"%PATH4%" "%PATH2%" "%PATH3%" *.tbi /mir /copy:DAT /r:0 /xj /v /tee /DCOPY:T

AlanD
Post Reply