Robocopy /purge inconsistent behavior

Copper Contributor

Hello,

I'm unfortunately writing this while trying to recover TBs of data.

 

Scenario:

Disk D which contains Directory Junctions gets backed up to Disk Y using -

robocopy * D:\ Y:\ /E /SJ /DST /PURGE /TEE /LOG:robocopy2.log

 

This has been working well for years.

If a directory has contents including Junctions on D, that same directory contents and Junction is re-created on Y.  This is working as expected.

 

Today, I didn't realize I had renamed a directory on Y that had Junctions pointing back to various directories on D and another drive M.

 

When the renamed directory on Y (which does not exist on D) was deleted, what happened was that the included Junction was FOLLOWED and all contents of the junction (my master files on D) were deleted on D as well as on another drive M.  Expectation was that only the junction would be deleted, just as only the junctions get created when using the robocopy command and /SJ flags.

 

It seems during create junctions are created WITHOUT FOLLOWING and copying contents

but during delete/purge, junctions are deleted AND FOLLOWED, thus deleting everything the junction pointed to.  /SJ seems to only work during creation, not purge.

 

If I hadn't renamed the directory on Y, things would have proceeded as expected as they have for years.

 

This seems like a bug and inconsistent behavior.

If it was user error, I'd be grateful for corrected syntax of my robocopy command.

 

Thank you

0 Replies