Help with revised Backup Strategy and Robocopy Mirror Script


Fozzie Bear

Active member
Local time
6:56 PM
Posts
32
OS
Windows 10 Home 22H2 (Build 19045.4291)
I’m reviewing my backup strategy of all my personal files. I have about 900Gb of family photos and videos which I want to maintain. Currently these sit on a PC which acts as a family network server. This has 8Tb of storage made up of several drives in mirror raid mode.

Local PCs have their Documents, Videos, and Music library’s redirected to a network share for each of these categories.

I use Robocopy to run a nightly backup of each of these network shares to an external1Tb eSata drive attached to the server. This external hard drive is the location for my OneDrive folder so anything copied into this folder is then synced to OneDrive.

However, I am now nearing my 1Tb OneDrive limit so want to thin out some of the files. My robocopy script just copies everything to the hard drive but over the years I have deleted files from the source as they are no longer required or more generally have renamed them so there are duplicates. The source therefore contains lots of files that I have decided I don’t need.

I don’t want to delete any of these files in case I delete a file in error which is then not noticed for a while. Using a robocopy mirror script will purge from the destination and consequently from OneDrive.

I would therefore like to run two backups separated by time. The first to an 8Tb drive on an always on NUC so I keep a full copy of everything. Then later a second backup using mirror to the 1Tb eSata drive on the server. This would purge all the deleted and renamed files uploaded to OneDrive but I will still have a full backup on the NUC.

Long intro sorry, but a few questions:-

1) Can you create two scripts within the same batch file separated by time or should I create a second batch file and run it at a separate time?

2) When specifying a network share is it better to use the machine name or IP address e.g. \\backup-Nuc\D\Videos or \\ipaddress\D\Videos

Here is my current batch file content:-

Robocopy "D:\Documents" "E:\Onedrive\Documents" *.* /E /COPYALL /XO /MT[:n] /LOG:"C:\Users\Admin\Desktop\documents.txt" /Z /R:3 /W:10

Robocopy "D:\Videos" "E:\Onedrive\Videos" *.* /E /COPYALL /XO /MT[:n] /LOG:"C:\Users\Admin\Desktop\videos.txt" /Z /R:3 /W:10

Robocopy "D:\Photos" "E:\Onedrive\Photos" *.* /E /COPYALL /XO /MT[:n] /LOG:"C:\Users\Admin\Desktop\photos.txt" /Z /R:3 /W:10

Robocopy "D:\Downloaded Photos" "E:\Downloaded Photos" *.* /E /COPYALL /XO /MT[:n] /LOG:"C:\Users\Admin\Desktop\Downloaded Photos.txt" /Z /R:3 /W:10

I need to change each the above scripts to copy to \\Backup-nuc\d\Videos or IP address as advised. I then need to run the same scripts with mirror and purge switches. Is this example correct for mirror:-

Robocopy "D:\Documents" "E:\Onedrive\Documents" *.* /E /MIR /Purge /XO /MT[:n] /LOG:"C:\Users\Admin\Desktop\documents.txt" /Z /R:3 /W:10

Its a long while since I created these scripts which took a lot of head scratching when they didn't initially work.
Many thanks
 
Windows Build/Version
Desktops Win11 23H2, Server Win10 22H2

My Computer

System One

  • OS
    Windows 10 Home 22H2 (Build 19045.4291)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Gigabyte B85M-D3H
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (8 CPUs)
    Motherboard
    Gigabyte B85M-D3H
    Memory
    16.0 Gb
    Graphics Card(s)
    Integrated Intel(R) HD Graphics 4600
    Sound Card
    Intel Digital Audio (S/PDIF) (High Definition Audio Device)
    Monitor(s) Displays
    BenQ G2420HD
    Screen Resolution
    1920x1080
    Hard Drives
    Primary: Samsung SSD 840 EVO 250GB Secondary 1: Seagate ST31000524AS (NTFS) Secondary 2: Seagate ST1000DM005 HD103SJ(exFat)
    PSU
    OCZ 550w
    Case
    LianLi
    Cooling
    ThermoLab Trinity
    Keyboard
    Dell (Logitech) Wireless keyboard
    Mouse
    Dell (Logitech) Wireless Mouse
    Internet Speed
    100mb FTTP
I’m reviewing my backup strategy of all my personal files. I have about 900Gb of family photos and videos which I want to maintain. Currently these sit on a PC which acts as a family network server. This has 8Tb of storage made up of several drives in mirror raid mode.

Local PCs have their Documents, Videos, and Music library’s redirected to a network share for each of these categories.

I use Robocopy to run a nightly backup of each of these network shares to an external1Tb eSata drive attached to the server. This external hard drive is the location for my OneDrive folder so anything copied into this folder is then synced to OneDrive.

However, I am now nearing my 1Tb OneDrive limit so want to thin out some of the files. My robocopy script just copies everything to the hard drive but over the years I have deleted files from the source as they are no longer required or more generally have renamed them so there are duplicates. The source therefore contains lots of files that I have decided I don’t need.

I don’t want to delete any of these files in case I delete a file in error which is then not noticed for a while. Using a robocopy mirror script will purge from the destination and consequently from OneDrive.

I would therefore like to run two backups separated by time. The first to an 8Tb drive on an always on NUC so I keep a full copy of everything. Then later a second backup using mirror to the 1Tb eSata drive on the server. This would purge all the deleted and renamed files uploaded to OneDrive but I will still have a full backup on the NUC.

Long intro sorry, but a few questions:-

1) Can you create two scripts within the same batch file separated by time or should I create a second batch file and run it at a separate time?

2) When specifying a network share is it better to use the machine name or IP address e.g. \\backup-Nuc\D\Videos or \\ipaddress\D\Videos

Here is my current batch file content:-

Robocopy "D:\Documents" "E:\Onedrive\Documents" *.* /E /COPYALL /XO /MT[:n] /LOG:"C:\Users\Admin\Desktop\documents.txt" /Z /R:3 /W:10

Robocopy "D:\Videos" "E:\Onedrive\Videos" *.* /E /COPYALL /XO /MT[:n] /LOG:"C:\Users\Admin\Desktop\videos.txt" /Z /R:3 /W:10

Robocopy "D:\Photos" "E:\Onedrive\Photos" *.* /E /COPYALL /XO /MT[:n] /LOG:"C:\Users\Admin\Desktop\photos.txt" /Z /R:3 /W:10

Robocopy "D:\Downloaded Photos" "E:\Downloaded Photos" *.* /E /COPYALL /XO /MT[:n] /LOG:"C:\Users\Admin\Desktop\Downloaded Photos.txt" /Z /R:3 /W:10

I need to change each the above scripts to copy to \\Backup-nuc\d\Videos or IP address as advised. I then need to run the same scripts with mirror and purge switches. Is this example correct for mirror:-

Robocopy "D:\Documents" "E:\Onedrive\Documents" *.* /E /MIR /Purge /XO /MT[:n] /LOG:"C:\Users\Admin\Desktop\documents.txt" /Z /R:3 /W:10

Its a long while since I created these scripts which took a lot of head scratching when they didn't initially work.
Many thanks

My advice would be to have as a local server a LINUX machine -- and then you can use an easy Crontab to back up users PC's and use GRSYNC (a graphical front end for rsync) for backing up other data -- it has various options such as not overwriting specific files, only overwriting newer files etc etc etc.

OK a bit of a learning curve if you don't know Linux but for this type of stuff unless you use Windows server which is expensive and grossly overkill for home users it's all free and well worth the time invested in learning it.

Both Linux and Windows have their specific strengths -- things like backup / servers etc Linux simply outshines (and out performs) all domestic versions of Windows hands down -. Great for file streaming of multi-media too. For typical Windows users Linux Mint or Fedora with KDE desktop are probably the easiest and most "Windows like" for Windows users to get to grips with. You can easily try out these by downloading bootable "Live distros" to a USB device which don't alter / change your current Windows system(s). Linux has no problems either with reading / writing NTFS files and you don't need to use SMB1 for file sharing etc.

Cheers
jimbo
 

My Computer

System One

  • OS
    Windows XP,11 Linux Fedora Rawhide pre-release 45
    Computer type
    PC/Desktop
    CPU
    2 X Intel i7
    Screen Resolution
    4KUHD X 2
You can easily create as many robocopy scripts as you want in a batch file. When it hits the first robocopy command it will run it, but it will not move on to the 2nd command until that 1st one has completed which is exactly what I think you want to do.

As for using a name versus an IP address you really can use either, but if you do not have a static IP address you might be better off using the name since the IP address could potentially change although not likely.

I am a seriously big fan of Robocopy. I use it extensively within batch files and I probably have at least 100 calls to it in one of my programs, however I would like to make a suggestion for the type of task that you are doing: Try taking a look at a program called FreeFileSync. I have a link to it below. That program is so perfect for the type of thing that you are doing and it's a quality piece of free software. In fact, I like that program so much that if you told me that I had to give up every program I own but I could keep only 3, FreFileSync would definitely be one of those 3programs.

FreeFileSync has a lot of great features but just to single out one here as an example: Let's say you're syncing some large files like ISO images. Now on your source you rename some of them. If you are syncing with robocopy it's going to see those as if they are completely new files and it will have to copy the entire file over to the destination. FreeFileSync can automatically figure out that these files have simply been renamed and so it won't have to copy the files to the destination. It simply renames them on the destination. In addition, if you move files to a different location, it figures that out and then simply moves them on the destination. If you're working with large amounts of data, it can make the difference between taking minutes or even hours with robocopy to mere seconds with FreeFileSync.

Link to FreeFileSync:

 

My Computers

System One System Two

  • OS
    Win11 Pro 25H2 (RTM+)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Acemagic
    CPU
    Intel i7-14650HX
    Memory
    32 GB
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    Varies as machine will often be moved to locations with different monitors
    Screen Resolution
    Varies
    Hard Drives
    1 x 1TB Gen 4 NVMe SSD
    PSU
    120W Power Brick
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
  • Operating System
    Win11 Pro 25H2 (RTM+)
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo ThinkBook 13x Gen 2
    CPU
    Intel i7-1255U
    Memory
    16 GB
    Graphics card(s)
    Intel Iris Xe Graphics
    Sound Card
    Realtek® ALC3306-CG codec
    Monitor(s) Displays
    13.3-inch IPS Display
    Screen Resolution
    WQXGA (2560 x 1600)
    Hard Drives
    2 TB 4 x 4 NVMe SSD
    PSU
    USB-C / Thunderbolt 4 Power / Charging
    Keyboard
    Backlit, spill resistant keyboard
    Mouse
    Buttonless Glass Precision Touchpad
    Internet Speed
    1Gb Up / 1Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    WiFi 6e / Bluetooth 5.1 / Facial Recognition / Fingerprint Sensor / ToF (Time of Flight) Human Presence Sensor
My advice would be to have as a local server a LINUX machine -- and then you can use an easy Crontab to back up users PC's and use GRSYNC (a graphical front end for rsync) for backing up other data -- it has various options such as not overwriting specific files, only overwriting newer files etc etc etc.

OK a bit of a learning curve if you don't know Linux but for this type of stuff unless you use Windows server which is expensive and grossly overkill for home users it's all free and well worth the time invested in learning it.

Both Linux and Windows have their specific strengths -- things like backup / servers etc Linux simply outshines (and out performs) all domestic versions of Windows hands down -. Great for file streaming of multi-media too. For typical Windows users Linux Mint or Fedora with KDE desktop are probably the easiest and most "Windows like" for Windows users to get to grips with. You can easily try out these by downloading bootable "Live distros" to a USB device which don't alter / change your current Windows system(s). Linux has no problems either with reading / writing NTFS files and you don't need to use SMB1 for file sharing etc.

Cheers
jimbo
Many thanks for the quick reply @jimbo45 I have used Linux but I find it very difficult to find my way around it like I do windows particularly networking and smb etc. If I was brought up on DOS it may be a different story but in this particular scenario our network server also runs plex and other windows only apps. It also has DriveBender as the underlying file storage system to provide better resilience that Storage Spaces.
John
 

My Computer

System One

  • OS
    Windows 10 Home 22H2 (Build 19045.4291)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Gigabyte B85M-D3H
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (8 CPUs)
    Motherboard
    Gigabyte B85M-D3H
    Memory
    16.0 Gb
    Graphics Card(s)
    Integrated Intel(R) HD Graphics 4600
    Sound Card
    Intel Digital Audio (S/PDIF) (High Definition Audio Device)
    Monitor(s) Displays
    BenQ G2420HD
    Screen Resolution
    1920x1080
    Hard Drives
    Primary: Samsung SSD 840 EVO 250GB Secondary 1: Seagate ST31000524AS (NTFS) Secondary 2: Seagate ST1000DM005 HD103SJ(exFat)
    PSU
    OCZ 550w
    Case
    LianLi
    Cooling
    ThermoLab Trinity
    Keyboard
    Dell (Logitech) Wireless keyboard
    Mouse
    Dell (Logitech) Wireless Mouse
    Internet Speed
    100mb FTTP
Many thanks for the quick reply @jimbo45 I have used Linux but I find it very difficult to find my way around it like I do windows particularly networking and smb etc. If I was brought up on DOS it may be a different story but in this particular scenario our network server also runs plex and other windows only apps. It also has DriveBender as the underlying file storage system to provide better resilience that Storage Spaces.
John
That's fine -- I was only making a suggestion.

I agree about Storage spaces -- hideous and breaks easily. Linux BTW has decent software RAID too and you don't have to have all the HDD's the same size (capacity) or Geometry (sectors / LBA etc etc). You can also run very efficient (almost Native speeds) Windows Virtual machines on Linux too -- however that's another issue especially if you are unfamiliar wirh the concept of Virtual Machines.

BTW as for PLEX -- I find KODI a much better system (and free) but it's tricky to set up. I use it a lot on Amazon firesticks to stream stuff from HDD etc to remote TV's -- don't though buy the latest versions of firesticks as the OS has changed and you can't sideload 3rd party apps (the press 7 times etc doesn't work to get into developer mode to change options etc). There are still plenty of the slightly earlier sticks around.

New Roku sticks also have done the same thing restricting sideloading of apps.

Cheers
jimbo
 

My Computer

System One

  • OS
    Windows XP,11 Linux Fedora Rawhide pre-release 45
    Computer type
    PC/Desktop
    CPU
    2 X Intel i7
    Screen Resolution
    4KUHD X 2
You can easily create as many robocopy scripts as you want in a batch file. When it hits the first robocopy command it will run it, but it will not move on to the 2nd command until that 1st one has completed which is exactly what I think you want to do.
Thanks @hsehestedt is there a pause option in robocopy to wait between scripts? I'm just wondering if a backup fails with errors if it will still proceed to the next script?
As for using a name versus an IP address you really can use either, but if you do not have a static IP address you might be better off using the name since the IP address could potentially change although not likely.
Thanks. All my important PCs and devices have static IP addresses. Not so bad lately but at one time I could find devices on my LAN by machine name only IP address.
FreeFileSync has a lot of great features but just to single out one here as an example: Let's say you're syncing some large files like ISO images. Now on your source you rename some of them. If you are syncing with robocopy it's going to see those as if they are completely new files and it will have to copy the entire file over to the destination. FreeFileSync can automatically figure out that these files have simply been renamed and so it won't have to copy the files to the destination. It simply renames them on the destination. In addition, if you move files to a different location, it figures that out and then simply moves them on the destination. If you're working with large amounts of data, it can make the difference between taking minutes or even hours with robocopy to mere seconds with FreeFileSync.

Link to FreeFileSync:

Thanks for the tip on FreeFile Sync. I actually use it for a lot of my transfers of files from one location to another when backing up PCs etc. Its a great tool. However I was not aware that it could identify the same file with a different file name. You have taught me something which I was not aware of and will look more closely at the program. I assume this function is buried in some of the advanced settings?
In the meantime I would really appreciate if I have the syntax correct for my revised mirror scripts here:-

Robocopy "D:\Documents" "E:\Onedrive\Documents" *.* /E /MIR /Purge /XO /MT[:n] /LOG:"C:\Users\Admin\Desktop\documents.txt" /Z /R:3 /W:10

Many thanks
John
 

My Computer

System One

  • OS
    Windows 10 Home 22H2 (Build 19045.4291)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Gigabyte B85M-D3H
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (8 CPUs)
    Motherboard
    Gigabyte B85M-D3H
    Memory
    16.0 Gb
    Graphics Card(s)
    Integrated Intel(R) HD Graphics 4600
    Sound Card
    Intel Digital Audio (S/PDIF) (High Definition Audio Device)
    Monitor(s) Displays
    BenQ G2420HD
    Screen Resolution
    1920x1080
    Hard Drives
    Primary: Samsung SSD 840 EVO 250GB Secondary 1: Seagate ST31000524AS (NTFS) Secondary 2: Seagate ST1000DM005 HD103SJ(exFat)
    PSU
    OCZ 550w
    Case
    LianLi
    Cooling
    ThermoLab Trinity
    Keyboard
    Dell (Logitech) Wireless keyboard
    Mouse
    Dell (Logitech) Wireless Mouse
    Internet Speed
    100mb FTTP
1) Two scripts might have some advantage in each being simpler and therefore easier to debug/modify. But I don't know exactly what you mean by "separated by time".
- If you just mean you will run one then the other you could still choose either option.
- I'd normally choose a single, combined script that looped through two similar sets of commands [some with /MIR, some without] to represent what I think you've said.
2) I agree with hsehestedt, you can use either but using the name guards against IP addresses changing. In addition to which, you probably think of the drives by name not their full IP address so using name in the script(s) will mean something to you and hence guard against mistakes in coding.

My other comments

is there a pause option in robocopy to wait between scripts?
Yes, you can insert pauses anywhere you want between individual commands in a script
I'm just wondering if a backup fails with errors if it will still proceed to the next script?
And you can write in If commands so you can respond appropriately to various errorlevels.
my ditty about open applications and RoboCopy exceptions - TenForums
I use the code at the end of that post to decide whether to include or exclude my Outlook 2007 pst files from RoboCopying [Outlook gets really stroppy about its pst files being copied while it's running].
I can discuss this topic with you if you want.

MIR includes Purge

is wrong. It's stated like that in the command's Help with the intention that you write in a number in place of the N.
You would be better off omitting it than writing it incorrectly. It would then assume its default value [explained in the Help and my links below]; I have no idea what it does when you write in N.
Nobody can tell you what value is best. It depends.
- I ran a series of experiments and found that value 32 ran quickest when RoboCopying between my computers.
- I've since retired one of those computers so I ought to repeat my experiments.
- Using the right value can make a lot of difference such as 2 minutes to complete the script instead of 15 minutes.

My 'template' RoboCopy command for my batch files is
Set BackupDrive=G:
RoboCopy "D:\Documents\Work" "%BackupDrive%\Documents\Work" /S /R:10 /MT:32 /DST /FFT /NDL /DCOPY:DAT /XA:SH /MIR
You can look up each of these switches in the links then ask any questions you want.

Robocopy - SS64
RoboCopy - MSLearn
RoboCopy -DST -FFT -NDL switches - my post #17 - TenForums
my ditty about open applications and RoboCopy exceptions - TenForums
my ditty - Using RoboCopy threading - post #10 - TenForums

RoboCopy is almost the same in Windows 11 & Windows 10.
The Windows 11 version has these switches that Windows 10's version does not. I've never used any of these additional switches and I don't know any more about them than what is written in its Help and reproduced below.

DCOPY has an additional option
DCOPY/COMPRESS :: Request network compression during file transfer, if applicable.

And
:: Copy File Throttling Options :
::
/IoMaxSize:n[KMG] :: Requested max i/o size per {read,write} cycle, in n [KMG] bytes.
/IoRate:n[KMG] :: Requested i/o rate, in n [KMG] bytes per second.
/Threshold:n[KMG] :: File size threshold for throttling, in n [KMG] bytes (see Remarks).

And
/XF file [file]... :: eXclude Files matching given names/paths/wildcards.
/XD dirs [dirs]... :: eXclude Directories matching given names/paths.
have the additional switch
/IM :: Include Modified files (differing change times).

And Retry Options for Windows 11 has this additional switch
/LFSM:n[KMG] :: /LFSM, specifying the floor size in n [K:kilo,M:mega,G:giga] bytes.

And the Windows 11 command's Help includes these additional remarks
::
:: Remarks :
::
Using /PURGE or /MIR on the root directory of the volume formerly caused
robocopy to apply the requested operation on files inside the System
Volume Information directory as well. This is no longer the case; if
either is specified, robocopy will skip any files or directories with that
name in the top-level source and destination directories of the copy session.

The modified files classification applies only when both source
and destination filesystems support change timestamps (e.g., NTFS)
and the source and destination files have different change times but are
otherwise the same. These files are not copied by default; specify /IM
to include them.

The /DCOPY:E flag requests that extended attribute copying should be
attempted for directories. Note that currently robocopy will continue
if a directory's EAs could not be copied. This flag is also not included
in /COPYALL.


Best of luck,
Denis
 
Last edited:

My Computer

System One

  • OS
    Windows 11 Home x64 Version 25H2 Build 26200.8037
Thanks @hsehestedt is there a pause option in robocopy to wait between scripts? I'm just wondering if a backup fails with errors if it will still proceed to the next script?

Thanks. All my important PCs and devices have static IP addresses. Not so bad lately but at one time I could find devices on my LAN by machine name only IP address.

Thanks for the tip on FreeFile Sync. I actually use it for a lot of my transfers of files from one location to another when backing up PCs etc. Its a great tool. However I was not aware that it could identify the same file with a different file name. You have taught me something which I was not aware of and will look more closely at the program. I assume this function is buried in some of the advanced settings?
In the meantime I would really appreciate if I have the syntax correct for my revised mirror scripts here:-

Robocopy "D:\Documents" "E:\Onedrive\Documents" *.* /E /MIR /Purge /XO /MT[:n] /LOG:"C:\Users\Admin\Desktop\documents.txt" /Z /R:3 /W:10

Many thanks
John

As Denis noted, you can simply drop in a pause command like this:

Robocopy command 1
pause
Robocopy command 2

As for FreeFileSync, that capability is automagically enabled IF you choose the option to use a database. You will find that option at the top of the Syncronization tab.
 

My Computers

System One System Two

  • OS
    Win11 Pro 25H2 (RTM+)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Acemagic
    CPU
    Intel i7-14650HX
    Memory
    32 GB
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    Varies as machine will often be moved to locations with different monitors
    Screen Resolution
    Varies
    Hard Drives
    1 x 1TB Gen 4 NVMe SSD
    PSU
    120W Power Brick
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
  • Operating System
    Win11 Pro 25H2 (RTM+)
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo ThinkBook 13x Gen 2
    CPU
    Intel i7-1255U
    Memory
    16 GB
    Graphics card(s)
    Intel Iris Xe Graphics
    Sound Card
    Realtek® ALC3306-CG codec
    Monitor(s) Displays
    13.3-inch IPS Display
    Screen Resolution
    WQXGA (2560 x 1600)
    Hard Drives
    2 TB 4 x 4 NVMe SSD
    PSU
    USB-C / Thunderbolt 4 Power / Charging
    Keyboard
    Backlit, spill resistant keyboard
    Mouse
    Buttonless Glass Precision Touchpad
    Internet Speed
    1Gb Up / 1Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    WiFi 6e / Bluetooth 5.1 / Facial Recognition / Fingerprint Sensor / ToF (Time of Flight) Human Presence Sensor
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Pavilion
    CPU
    AMD Ryzen 7 5700G
    Motherboard
    Erica6
    Memory
    Micron Technology DDR4-3200 16GB
    Graphics Card(s)
    NVIDIA GeForce RTX 3060
    Sound Card
    Realtek ALC671
    Monitor(s) Displays
    Samsung SyncMaster U28E590
    Screen Resolution
    3840 x 2160
    Hard Drives
    SAMSUNG MZVLQ1T0HALB-000H1

All RoboCopy /MIR commands are, in effect, incremental.
So are other combinations of RoboCopy switches.

Each to their own but, personally, I think my chosen selection of RoboCopy switches is better. See my post #7. My choice of switches has evolved over many years and has benefitted from the contributions of several forum members & work colleagues.


Denis
 

My Computer

System One

  • OS
    Windows 11 Home x64 Version 25H2 Build 26200.8037
I really love robocopy for the shear versatility, but there are some big shortcomings that it has that force me to use alternatives for some tasks. As long as it has been around, I wish Microsoft would take two days out of some Engineer's mad push to integrate AI into yet more useless places and give robocopy a little love.

As an example, robocopy will not accept GUID volume IDs like this:

\\?\Volume{15163bff-6e6d-430d-b472-763248dc1b52}\

I find this unforgivable. It would make reference to portable drives, thumb drives, etc. so much easier since the drive letter for those devices can change, especially when moved between PCs. Yes, there are workarounds so there is no need to point these out to me :-), but this is just one example. I would even accept it if robocopy could use a volume name rather than a drive letter, but it cannot handle that either.
 

My Computers

System One System Two

  • OS
    Win11 Pro 25H2 (RTM+)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Acemagic
    CPU
    Intel i7-14650HX
    Memory
    32 GB
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    Varies as machine will often be moved to locations with different monitors
    Screen Resolution
    Varies
    Hard Drives
    1 x 1TB Gen 4 NVMe SSD
    PSU
    120W Power Brick
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
  • Operating System
    Win11 Pro 25H2 (RTM+)
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo ThinkBook 13x Gen 2
    CPU
    Intel i7-1255U
    Memory
    16 GB
    Graphics card(s)
    Intel Iris Xe Graphics
    Sound Card
    Realtek® ALC3306-CG codec
    Monitor(s) Displays
    13.3-inch IPS Display
    Screen Resolution
    WQXGA (2560 x 1600)
    Hard Drives
    2 TB 4 x 4 NVMe SSD
    PSU
    USB-C / Thunderbolt 4 Power / Charging
    Keyboard
    Backlit, spill resistant keyboard
    Mouse
    Buttonless Glass Precision Touchpad
    Internet Speed
    1Gb Up / 1Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    WiFi 6e / Bluetooth 5.1 / Facial Recognition / Fingerprint Sensor / ToF (Time of Flight) Human Presence Sensor

My Computer

System One

  • OS
    Windows 11 Pro 25H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Core i7-1260P
    Motherboard
    NUC12WSBi7
    Memory
    64 GB Micron PC4-25600
    Graphics Card(s)
    Intel Iris Xe Graphics
    Sound Card
    on-board Realtek HD Audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840 x 2160
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Crucial MX500 2 TB
    Antivirus
    Microsoft Defender
1) Two scripts might have some advantage in each being simpler and therefore easier to debug/modify. But I don't know exactly what you mean by "separated by time".
- If you just mean you will run one then the other you could still choose either option.
- I'd normally choose a single, combined script that looped through two similar sets of commands [some with /MIR, some without] to represent what I think you've said.
2) I agree with hsehestedt, you can use either but using the name guards against IP addresses changing. In addition to which, you probably think of the drives by name not their full IP address so using name in the script(s) will mean something to you and hence guard against mistakes in coding.

My other comments


Yes, you can insert pauses anywhere you want between individual commands in a script

And you can write in If commands so you can respond appropriately to various errorlevels.
my ditty about open applications and RoboCopy exceptions - TenForums
I use the code at the end of that post to decide whether to include or exclude my Outlook 2007 pst files from RoboCopying [Outlook gets really stroppy about its pst files being copied while it's running].
I can discuss this topic with you if you want.

MIR includes Purge


is wrong. It's stated like that in the command's Help with the intention that you write in a number in place of the N.
You would be better off omitting it than writing it incorrectly. It would then assume its default value [explained in the Help and my links below]; I have no idea what it does when you write in N.
Nobody can tell you what value is best. It depends.
- I ran a series of experiments and found that value 32 ran quickest when RoboCopying between my computers.
- I've since retired one of those computers so I ought to repeat my experiments.
- Using the right value can make a lot of difference such as 2 minutes to complete the script instead of 15 minutes.

My 'template' RoboCopy command for my batch files is
Set BackupDrive=G:
RoboCopy "D:\Documents\Work" "%BackupDrive%\Documents\Work" /S /R:10 /MT:32 /DST /FFT /NDL /DCOPY:DAT /XA:SH /MIR
You can look up each of these switches in the links then ask any questions you want.

Robocopy - SS64
RoboCopy - MSLearn
RoboCopy -DST -FFT -NDL switches - my post #17 - TenForums
my ditty about open applications and RoboCopy exceptions - TenForums
my ditty - Using RoboCopy threading - post #10 - TenForums

RoboCopy is almost the same in Windows 11 & Windows 10.
The Windows 11 version has these switches that Windows 10's version does not. I've never used any of these additional switches and I don't know any more about them than what is written in its Help and reproduced below.

DCOPY has an additional option
DCOPY/COMPRESS :: Request network compression during file transfer, if applicable.

And
:: Copy File Throttling Options :
::
/IoMaxSize:n[KMG] :: Requested max i/o size per {read,write} cycle, in n [KMG] bytes.
/IoRate:n[KMG] :: Requested i/o rate, in n [KMG] bytes per second.
/Threshold:n[KMG] :: File size threshold for throttling, in n [KMG] bytes (see Remarks).

And
/XF file [file]... :: eXclude Files matching given names/paths/wildcards.
/XD dirs [dirs]... :: eXclude Directories matching given names/paths.
have the additional switch
/IM :: Include Modified files (differing change times).

And Retry Options for Windows 11 has this additional switch
/LFSM:n[KMG] :: /LFSM, specifying the floor size in n [K:kilo,M:mega,G:giga] bytes.

And the Windows 11 command's Help includes these additional remarks
::
:: Remarks :
::
Using /PURGE or /MIR on the root directory of the volume formerly caused
robocopy to apply the requested operation on files inside the System
Volume Information directory as well. This is no longer the case; if
either is specified, robocopy will skip any files or directories with that
name in the top-level source and destination directories of the copy session.

The modified files classification applies only when both source
and destination filesystems support change timestamps (e.g., NTFS)
and the source and destination files have different change times but are
otherwise the same. These files are not copied by default; specify /IM
to include them.

The /DCOPY:E flag requests that extended attribute copying should be
attempted for directories. Note that currently robocopy will continue
if a directory's EAs could not be copied. This flag is also not included
in /COPYALL.


Best of luck,
Denis
Many thanks Denis. That's really informative. Robocopy has come a long way from the days it was invented to write and copy data from satellites with poor data links. I will amend my script with the \Mir switch and put a value in MT:[N] and just try it. To be honest after @hsehestedt revelation about its functionality, as I have FreeFile Sync installed I am erring to moving over to that for my backups.
Many thanks for your reply
 

My Computer

System One

  • OS
    Windows 10 Home 22H2 (Build 19045.4291)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Gigabyte B85M-D3H
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (8 CPUs)
    Motherboard
    Gigabyte B85M-D3H
    Memory
    16.0 Gb
    Graphics Card(s)
    Integrated Intel(R) HD Graphics 4600
    Sound Card
    Intel Digital Audio (S/PDIF) (High Definition Audio Device)
    Monitor(s) Displays
    BenQ G2420HD
    Screen Resolution
    1920x1080
    Hard Drives
    Primary: Samsung SSD 840 EVO 250GB Secondary 1: Seagate ST31000524AS (NTFS) Secondary 2: Seagate ST1000DM005 HD103SJ(exFat)
    PSU
    OCZ 550w
    Case
    LianLi
    Cooling
    ThermoLab Trinity
    Keyboard
    Dell (Logitech) Wireless keyboard
    Mouse
    Dell (Logitech) Wireless Mouse
    Internet Speed
    100mb FTTP
Thanks @FreeBooter . I actually came across your script whilst searching the forums. You clearly have some programming background or at the least a clear grasp of command prompt so understand what you are doing. I looked at the script and was lost so went back to what was basic for my needs.
thanks for posting though.
John
 

My Computer

System One

  • OS
    Windows 10 Home 22H2 (Build 19045.4291)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Gigabyte B85M-D3H
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (8 CPUs)
    Motherboard
    Gigabyte B85M-D3H
    Memory
    16.0 Gb
    Graphics Card(s)
    Integrated Intel(R) HD Graphics 4600
    Sound Card
    Intel Digital Audio (S/PDIF) (High Definition Audio Device)
    Monitor(s) Displays
    BenQ G2420HD
    Screen Resolution
    1920x1080
    Hard Drives
    Primary: Samsung SSD 840 EVO 250GB Secondary 1: Seagate ST31000524AS (NTFS) Secondary 2: Seagate ST1000DM005 HD103SJ(exFat)
    PSU
    OCZ 550w
    Case
    LianLi
    Cooling
    ThermoLab Trinity
    Keyboard
    Dell (Logitech) Wireless keyboard
    Mouse
    Dell (Logitech) Wireless Mouse
    Internet Speed
    100mb FTTP
Thanks @FreeBooter . I actually came across your script whilst searching the forums. You clearly have some programming background or at the least a clear grasp of command prompt so understand what you are doing. I looked at the script and was lost so went back to what was basic for my needs.
thanks for posting though.
John
You are very welcome!
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Pavilion
    CPU
    AMD Ryzen 7 5700G
    Motherboard
    Erica6
    Memory
    Micron Technology DDR4-3200 16GB
    Graphics Card(s)
    NVIDIA GeForce RTX 3060
    Sound Card
    Realtek ALC671
    Monitor(s) Displays
    Samsung SyncMaster U28E590
    Screen Resolution
    3840 x 2160
    Hard Drives
    SAMSUNG MZVLQ1T0HALB-000H1

My Computer

System One

  • OS
    Windows 10 Home 22H2 (Build 19045.4291)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Gigabyte B85M-D3H
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (8 CPUs)
    Motherboard
    Gigabyte B85M-D3H
    Memory
    16.0 Gb
    Graphics Card(s)
    Integrated Intel(R) HD Graphics 4600
    Sound Card
    Intel Digital Audio (S/PDIF) (High Definition Audio Device)
    Monitor(s) Displays
    BenQ G2420HD
    Screen Resolution
    1920x1080
    Hard Drives
    Primary: Samsung SSD 840 EVO 250GB Secondary 1: Seagate ST31000524AS (NTFS) Secondary 2: Seagate ST1000DM005 HD103SJ(exFat)
    PSU
    OCZ 550w
    Case
    LianLi
    Cooling
    ThermoLab Trinity
    Keyboard
    Dell (Logitech) Wireless keyboard
    Mouse
    Dell (Logitech) Wireless Mouse
    Internet Speed
    100mb FTTP
I never noticed this and it didn’t bother me; now it does. Thanks, @hsehestedt!

Sorry about that! Thankfully, there are workarounds like Denis noted, but this stuff does get a little frustrating.

I remember long ago back in the Windows NT days how Microsoft took one year to focus purely on quality and no major feature changes. I wish that they would do that again. Just give a little love to what is already there. For example, how many years will it take to transition from Control Panel to the new Settings? How many years can it take to actually finish building dark mode? Nope, it's more important to get Copilot into Notepad and Paint I guess.
 

My Computers

System One System Two

  • OS
    Win11 Pro 25H2 (RTM+)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Acemagic
    CPU
    Intel i7-14650HX
    Memory
    32 GB
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    Varies as machine will often be moved to locations with different monitors
    Screen Resolution
    Varies
    Hard Drives
    1 x 1TB Gen 4 NVMe SSD
    PSU
    120W Power Brick
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
  • Operating System
    Win11 Pro 25H2 (RTM+)
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo ThinkBook 13x Gen 2
    CPU
    Intel i7-1255U
    Memory
    16 GB
    Graphics card(s)
    Intel Iris Xe Graphics
    Sound Card
    Realtek® ALC3306-CG codec
    Monitor(s) Displays
    13.3-inch IPS Display
    Screen Resolution
    WQXGA (2560 x 1600)
    Hard Drives
    2 TB 4 x 4 NVMe SSD
    PSU
    USB-C / Thunderbolt 4 Power / Charging
    Keyboard
    Backlit, spill resistant keyboard
    Mouse
    Buttonless Glass Precision Touchpad
    Internet Speed
    1Gb Up / 1Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    WiFi 6e / Bluetooth 5.1 / Facial Recognition / Fingerprint Sensor / ToF (Time of Flight) Human Presence Sensor
I don't entirely disagree with that, but I'd push back a little and say that there are tons of Control Panel applets, from third parties and Microsoft. Their management interface for their own client for Configuration Manager is still a Control Panel applet. Even if you move all of the intrinsic Windows .cpl files to Settings, Control Panel will still need to exist [edit: for the foreseeable future, anyway].

And the skillsets to implement dark mode in piles of old C++ Win32 dialogs and to implement Copilot into modern Windows apps do not intersect. You can't just pull someone off of Notepad AI features and tell them to make some obscure dialog dark.
 
Last edited:

My Computer

System One

  • OS
    Windows 11 Pro 25H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Core i7-1260P
    Motherboard
    NUC12WSBi7
    Memory
    64 GB Micron PC4-25600
    Graphics Card(s)
    Intel Iris Xe Graphics
    Sound Card
    on-board Realtek HD Audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840 x 2160
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Crucial MX500 2 TB
    Antivirus
    Microsoft Defender

Latest Support Threads

Back
Top Bottom