Running robocopy after backup.

User discussion and information resource forum for Image products.

Running robocopy after backup.

Postby Ethereal » Sat Nov 19, 2016 1:06 pm

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
Ethereal
 
Posts: 6
Joined: Sat May 18, 2013 8:30 am

Re: Running robocopy after backup.

Postby TAC109 » Sat Nov 19, 2016 2:44 pm

The 'start' command should use the /w parameter so that it waits until the imaging has completed.
TAC109
 
Posts: 214
Joined: Tue Sep 06, 2011 3:41 pm

Re: Running robocopy after backup.

Postby Ethereal » Sat Nov 19, 2016 3:15 pm

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
Ethereal
 
Posts: 6
Joined: Sat May 18, 2013 8:30 am

Re: Running robocopy after backup.

Postby TAC109 » Sat Nov 19, 2016 5:24 pm

The /w (or /wait) parameter is for the 'start' command, so it should be placed immediately after 'start' (with an intervening space).
TAC109
 
Posts: 214
Joined: Tue Sep 06, 2011 3:41 pm

Re: Running robocopy after backup.

Postby Ethereal » Sat Nov 19, 2016 6:16 pm

that's working now - thank you very much :-)
Ethereal
 
Posts: 6
Joined: Sat May 18, 2013 8:30 am

Re: Running robocopy after backup.

Postby AlanD » Thu Nov 24, 2016 10:36 am

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
AlanD
 
Posts: 192
Joined: Sat Sep 17, 2011 9:45 am


Return to Image for DOS/Linux/Windows

cron