Robocopy /IM

Microsoft Windows
Post Reply
User avatar
Simon Sheppard
Posts: 196
Joined: 2021-Jul-10, 7:46 pm
Contact:

Robocopy /IM

Post by Simon Sheppard »

I updated the robocopy page yesterday to add the /IM and /COMPRESS options

/IM (include modified) has the help text "include modified files (differing change times)"
which doesn't make sense as copying files with a different last modified time or file size is the default action of Robocopy without any switches.

So I did some testing and it seems you have to change the Archive attribute on both the source and destination and then /IM will copy the file even if nothing else has changed.

It doesn't seem to matter if the archive attribute is set or unset, or even set and then immediately unset again, but both source and destination need to be changed and both need to be set to the same value and then /IM will see the files as having changed enough to trigger a fresh copy.

This doesn't seem very useful, but perhaps there is some other nuance which I'm missing?
workablob
Posts: 1
Joined: 2022-Sep-10, 5:55 pm

Re: Robocopy /IM

Post by workablob »

I got turned on to Robocopy years ago by a colleague in I.T.

It didn't take me long to realize I hate creating batch files so I did a google search for 'robocopy gui' and voila.

There are these:

Robogui
copyrite xp
rich copy

Some are free but the pay versions are reasonably priced.

Rich Copy is free and does not use Robocopy but it is pretty decent and was developed by a man from Microsoft.

CopyRite XP is fantastic but it's almost $20.00 :( I sprung for it and am happy with it) YMMV.

A quick Google search will yield results so I won't post any URLs here.

I am a gui guy so I love these options.
User avatar
Simon Sheppard
Posts: 196
Joined: 2021-Jul-10, 7:46 pm
Contact:

Re: Robocopy /IM

Post by Simon Sheppard »

@workablob, from your email address it looks very much like you may in fact be David Kendrick the author of copyrite xp and you have been spamming this identical message around multiple IT forums which mention robocopy, it is not a good look.

Also the website for copyrite xp is currently down, so maybe think about fixing that first!
Fernan
Posts: 2
Joined: 2024-May-23, 11:14 am

Re: Robocopy /IM

Post by Fernan »

"*This option is available on Windows Server 2016 and later.
In addition to the update time that is updated when the contents of a file are rewritten (the update time that can be checked in Explorer), Windows also manages the update time when an area called MFT (Master File Table) is updated. This update time is different from the update time you can see in Explorer.
When the file name, file attributes, or security information is changed, the MFT timestamp is also updated. When the MFT timestamp is updated, with the /IM option it is included in the copying target, so that even when additional information such as security information is changed, it is also included in the synchronization target.
*This is an unnecessary option when performing a one-time copy, but there is no harm in leaving it on. This is an option that shows its true value when you re-run robocopy for the purpose of performing differential synchronization from the second time onwards.
*Adding the /COPYALL option automatically enables the /IM option, but in this example, we added it explicitly."

https://win2012r2.com/2022/03/21/robocopy/
Fernan
Posts: 2
Joined: 2024-May-23, 11:14 am

Re: Robocopy /IM

Post by Fernan »

Hello,
I've been doing some testing and I think the behavior of /im is the following:
The MTF timestamp is modified by different operations, such as changing attributes or security permissions, or renaming the file (and setting it back to its previous name for our case). In the case where the source and destination files have the same size and modification date, both /it and /im check if the MFT timestamps of the source and destination files are different, although robocopy can't know which operation caused the change.

/it: if the MFT timestamps are different and any attribute (hidden, read-only or archive) is different the destination file is overwritten.

/im: if the MFT timestamps are different and all attributes (hidden, read-only and archive) are the same the destination file is overwritten.

Note:
The /copyall option doesn't automatically enable the /im option (Windows 11 23H2, robocopy.exe 10.0.22621.3527), but /copyall, /copy:DATS, /copy:DATSO and /copy:DATSOU behave the same as if the /im option would have been set.
Post Reply