ROBOCOPY - Create Backup Script

Page 13 of 32 FirstFirst ... 3111213141523 ... LastLast

  1. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
    Thread Starter
       #120

    Thanks NailIT! Welcome to SevenForums!
      My Computer


  2. Posts : 2
    Windows 7 64 bit Home
       #121

    I just joined after finding your excellent discussion from a Google search. Thanks for all the good information. I'm just starting to set a backup strategy to an external USB drive. I first just copied the directories but I noticed that the dates on the directories changed to the current date and some of the file dates changed also--that will not work for me.

    I used your most simple command line:
    robocopy E:\Data1 G:\Backups\Data1 /e /mir /np /log:backup_log.txt

    When I ran this with my direcotires and qiuckly checked the desintation, which was blank. created new directories with the current date--again not what I wanted.

    2 Questions---

    1 Is there a way to use Robocopy to preserve all the dates for all directories and all files?

    2 Is there a way to select copies from the source by FILE CREATION DATE? (Secondarily, can you point me to a good reference to dates for files and directories--I have heard that there are three different dates, creation, last modified, and last accessed)

    Thank you.
      My Computer


  3. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
    Thread Starter
       #122

    Hi Mooring10,

    Thanks for the feedback, and apologies for the delayed reply.

    The modified date of the folder will always change to the date that the copy is performed, since the folder is newly created on the USB device. The modified date of the files, however, should not change. Can you please check:
    - the date of the folder
    - the date of the files

    To be sure that the file attributes (incl. dates) are copied and preserved, add the /COPYALL option as shown below:

    Code:
    robocopy E:\Data1 G:\Backups\Data1 /e /mir /np /copyall /log:backup_log.txt
    To select files based on date, you need to use the /MAXLAD or /MINLAD OPTIONS. Please type the following at a command prompt and refer to those under the file selection options:

    Code:
    robocopy /?
    I found this articel that explains the different dates:
    All Windows file systems record the same three values:

    • Time/Date Created: When you create a new file or directory, this value is set and does not normally change (unless you deliberately change it). If you make a new copy of a file and save it to a different location, it is treated as a new file and a new creation time stamp is set. Moving a file or simply renaming it does not create a new file, and thus does not give the file a new creation time stamp. (Note: It is possible to end up with a file that has a modification time that's earlier than its creation time when you make a new copy of a file.)
    • Time/Date Modified: This is also called the Last Written date. Whenever the contents of the file are changed, or files are added to or deleted from a directory, this time stamp changes. Renaming the file doesn’t change the modification time stamp. Neither does opening the file without making any changes to it.
    • Time/Date Accessed: This is supposed to show the last time the file was accessed, but experience proves that opening and reading a file without making changes does not immediately change this time stamp in Windows XP (this is because of the variance in resolution time mentioned earlier).
    Build Your Skills: Learn to manipulate file time stamps in Windows | TechRepublic

    Regards,
    Golden
      My Computer


  4. Posts : 2
    Windows 7 64 bit Home
       #123

    Thanks for your reply.

    I trie your suggestion and used this line:

    robocopy "C:\Data 01" "P:\WD My Book ES\Backups\Data 01" /e /mir /np /copyall /log:backup_log.txt
    pause

    Note I think the command line is word wrapping on me.

    It goes to the pause statement without copying any files?
    Last edited by Mooring10; 27 Sep 2012 at 00:19. Reason: error
      My Computer


  5. Posts : 4
    Windows 7 x64
       #124

    Hello. Awesome tutorial. I don't know yet how I've missed this robocopy command all those years.

    Nevertheless, I have two questions:

    1 - Which version is the current version or robocopy?
    2 - How do I know which version do I have?

    Believe me, I know how to use google, but I'm giving up. Also, there are at least two hot-fixes:
    A robocopy command updates DACLs incorrectly in Windows 7 or in Windows Server 2008 R2
    "Robocopy /B" does not copy the security information such as ACL in Windows 7 and in Windows Server 2008 R2

    But, since I don't know which version I have I can't say for sure if I should apply them.
    My current system is Windows 7 x64 SP1 with the latest updates.

    Thanks in advance, and thanks again for this thread.

    PS: The only "Manual" I can find is a file called robocopy.pdf with the title "Robocopy.exe Robust File Copy Utility Version XP010"... As far as I know that product version in fairly outdated...
      My Computer


  6. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
    Thread Starter
       #125

    Hi,

    Thanks for the compliment.

    In C:\Windows\System32, find and right-click on Robocopy, then click Properties. Under the Details tab, you will find the version of Robocopy.

    ROBOCOPY - Create Backup Script-capture.png

    Regards,
    Golden
      My Computer


  7. Posts : 4
    Windows 7 x64
       #126

    That was easy. Sorry, I've installed Win7 yesterday for the first time, hence my disorientation... hehe.

    Well... I have the same version like you: 5.1.10.1027 but, shouldn't we have the 6.1.7601 bundled with Windows 7 (as Wikipedia says?) and if there is no 6.17601 version do you think I should apply those fixes?

    UPDATE:

    Ok, here is the thing: the latest version bundled with win7 and vista is this one: 5.1.10.1027 (which is not the same version even when they share the same version number).

    So I was thinking that there is no such a thing as version 6.1, and we have to correct wikipedia. But, reading here:

    http://en.wikipedia.org/wiki/Talk%3A...XP027.21.21.21

    There is a link to one of the hotfixes which, aparently, updates robocopy to a 6.1 version...
    http://support.microsoft.com/kb/2639043/en-us

    I cannot confirm all this, but makes sense to me now.

    Still I dunno if I should apply the fix....
    Last edited by motherpeople; 04 Oct 2012 at 01:54. Reason: Better understanding.
      My Computer


  8. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
    Thread Starter
       #127

    I would only apply it if you need it.....setup a test run to see what happens.
      My Computer


  9. Posts : 2
    Windows 7 64bit
       #128

    Backup Script


    I am having an issue with backing up the c:\user\username folder.
    Here is my script:
    robocopy "C:\Users\VocWorks User" E:\Backup /MIR /E
    pause

    It will copy Desktop, Favorites, My Documents, My Music and My Pictures. If there is any other folder in that directory it will not copy it. I have attached pictures of the Main drive and the Backup drive. Also it will only copy to the root of the drive not into a Folder called Backup. Any help would be greatly appropriated.
    Attached Thumbnails Attached Thumbnails ROBOCOPY - Create Backup Script-main.jpg   ROBOCOPY - Create Backup Script-backup.jpg  
      My Computer


  10. Posts : 4
    Windows 7 x64
       #129

    @champ488: Just for curiosity, why are you using both "/MIR /E" ? The manual says that "/MIR" Mirrors a directory tree (equivalent to /e plus /purge). So why the combination?

    About the latest update to 6.1: Robocopy is working beautiful for me even when the Owner flag is not copied or updated with any possible switch combination. So, I will not take a risk breaking what already works, I'll wait for a proper release.
      My Computer


 
Page 13 of 32 FirstFirst ... 3111213141523 ... LastLast

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

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