Windows Gurus please command to copy all directories from Disk A to B


  1. Posts : 11,247
    Windows / Linux : Arch Linux
       #1

    Windows Gurus please command to copy all directories from Disk A to B


    Hi folks - especially Windows Gurus please

    Is there a Windows command to copy all the directories and their files and sub directories from one disk or directory to another -- not a CLONE disk but just a file and directory copy with recursion if necessary. It should ignore existing files on the destination if they are newer than the files on the source.

    The Linux equivalent is simple : rsync -r -t -v --progress -s /<dev1> /<dev2> where<dev> = /dev/sdx etc.

    I'm sure there must be a Windows command to do it - I don't need any 3rd party GUI type things to achieve IMHO a simple process which is essentially building a data backup job to run periodically on users clients computers - the backup will then go to a remote (LAN actually) server.

    Note that rsync command with those particular parameters only copies non existing files to the target disk - but can copy if the files on destination are older than on source disk and a whole other slew of options etc.

    These things in theory should be simple -- but it always seems to me (possibly because I don't tend to use Windows as my main desktop) that Windows makes some essentially simple tasks far more complex than they need to be.

    Thanks in advance

    Cheers
    jimbo
      My Computer


  2. Posts : 2,149
    Windows 11 Pro (latest update ... forever anal)
       #2

    Have a look at Windows built-in command line Robocopy.

    Windows doesn't really make things hard, it's just that this type of thing is not meant to be done ... there's the issue of capturing/identifying/copying system and hidden.

    You won't be able to do this while a system is running (i.e. copy the running system drive) - many files are locked/protected when in use and can't be accessed to copy.

    Not fair to try and compare it to Linux because the architecture of the OSes is totally different.
      My Computers


  3. Posts : 41,480
    windows 10 professional version 1607 build 14393.969 64 bit
       #3
      My Computer


  4. Posts : 11,247
    Windows / Linux : Arch Linux
    Thread Starter
       #4

    idgat said:
    Have a look at Windows built-in command line Robocopy.

    Windows doesn't really make things hard, it's just that this type of thing is not meant to be done ... there's the issue of capturing/identifying/copying system and hidden.

    You won't be able to do this while a system is running (i.e. copy the running system drive) - many files are locked/protected when in use and can't be accessed to copy.

    Not fair to try and compare it to Linux because the architecture of the OSes is totally different.
    Hi there
    Thanks - that looks good
    The command was intended to be run on users own data areas so data is backed up either on demand or at EOD (End of day). There's nothing wrong IMO with users especially on networked computers wanting to back up their own "Home" type directories on demand so can be done while their system is running.

    Of course they can always back up data themselves to local storage but having a script they can run on demand like "Send directory / file" or "retrieve file / directory" seems fine to me.

    In some places as well use of external local storage devices is discouraged even on BYOD (Bring your Own Device) sites.

    Cheers
    jimbo
      My Computer


  5. Posts : 2,149
    Windows 11 Pro (latest update ... forever anal)
       #5

    jimbo45 said:
    Hi there
    Thanks - that looks good
    The command was intended to be run on users own data areas so data is backed up either on demand or at EOD (End of day).
    In that case, a scheduled task of running a Robocopy command line script is perfect.
      My Computers


  6. Posts : 5,330
    Windows 11 Pro 64-bit
       #6

    @jimbo45
    I have a batch script that will do total copy first and then incrementally, it just copies the new files and changed files.
    Windows Gurus please command to copy all directories from Disk A to B Attached Files
      My Computer


  7. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #7

    FreeBooter said:
    @jimbo45
    I have a batch script that will do total copy first and then incrementally, it just copies the new files and changed files.
    Believe it or not I have just found my copy of that exact same file that I was going to post for @jimbo45 but you beat me to it. I think I got it from StackOverflow or GitHub a long time ago!

    It is an excellent file that should do what he wants.
      My Computer


  8. Posts : 11,247
    Windows / Linux : Arch Linux
    Thread Starter
       #8

    Hi there
    Thanks folks

    Marking as solved.

    Cheers
    jimbo
      My Computer


  9. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #9

    jimbo45 said:
    Thanks folks

    Marking as solved.

    Cheers
    You are VERY welcome. I am glad you have found a solution.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:08.
Find Us




Windows 10 Forums