| Windows 7: ROBOCOPY - Create Backup Script |
18 Sep 2011
|
#119 | | Windows 7 Ultimate SP1 (x64) South Australia |
ROBOCOPY - Create Backup Script How to Create a Backup Script Using the ROBOCOPY Command
Last edited by Golden; 16 Oct 2012 at 07:59 AM..
| My System Specs |
| Computer type PC/Desktop System Manufacturer/Model Number Golden Mk. I.3 OS Windows 7 Ultimate SP1 (x64) CPU Intel i7 860 @ 2.80 GHz Motherboard Gigabyte P55A-UD3R Rev.1. Award BIOS F13 Memory 16GB Corsair Vengance DDR3 @ 661 MHz Dual Channel (9-9-9-24) Graphics Card EVGA NVidia GTX 560 1024MB Sound Card Realtek Integrated Monitor(s) Displays Dual Samsung SyncMaster 2494HS Screen Resolution 1920*1080 and 1920*1080 Keyboard Logitech G110 Mouse Logitech MX518 PSU Thermaltake ToughPower QFan 750W Case Thermaltake Element S VK60001W2Z Cooling Corsair H60 Water Cooling, 2*230mm and 2*80mm case fans Hard Drives 1*OCZ Vertex 2 60GB SSD;
2*Samsung F3 SpinPoint 1TB in RAID0;
3*Samsung F1 SpinPoint 1TB in RAID5;
1*Western Digital 500GB External USB 3.0
1*Seagate 500GB External USB 2.0 Internet Speed Not fast enough!!! Antivirus MSE and Malwarebytes Pro Browser Chrome Version 25 Other Info Laptop: ASUS X54C, Intel Core i3-2330M @ 2.0Ghz, 4GB RAM, Intel HD on-board graphics, Windows 7 Professional SP1 (x64), LinuxMint 14 (x64), PepperMint 3 (x86) |
31 Aug 2012
|
#120 | | Windows 7 Ultimate SP1 (x64) South Australia |
Thanks NailIT! Welcome to SevenForums! | My System Specs |
| Computer type PC/Desktop System Manufacturer/Model Number Golden Mk. I.3 OS Windows 7 Ultimate SP1 (x64) CPU Intel i7 860 @ 2.80 GHz Motherboard Gigabyte P55A-UD3R Rev.1. Award BIOS F13 Memory 16GB Corsair Vengance DDR3 @ 661 MHz Dual Channel (9-9-9-24) Graphics Card EVGA NVidia GTX 560 1024MB Sound Card Realtek Integrated Monitor(s) Displays Dual Samsung SyncMaster 2494HS Screen Resolution 1920*1080 and 1920*1080 Keyboard Logitech G110 Mouse Logitech MX518 PSU Thermaltake ToughPower QFan 750W Case Thermaltake Element S VK60001W2Z Cooling Corsair H60 Water Cooling, 2*230mm and 2*80mm case fans Hard Drives 1*OCZ Vertex 2 60GB SSD;
2*Samsung F3 SpinPoint 1TB in RAID0;
3*Samsung F1 SpinPoint 1TB in RAID5;
1*Western Digital 500GB External USB 3.0
1*Seagate 500GB External USB 2.0 Internet Speed Not fast enough!!! Antivirus MSE and Malwarebytes Pro Browser Chrome Version 25 Other Info Laptop: ASUS X54C, Intel Core i3-2330M @ 2.0Ghz, 4GB RAM, Intel HD on-board graphics, Windows 7 Professional SP1 (x64), LinuxMint 14 (x64), PepperMint 3 (x86) |
21 Sep 2012
|
#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 System Specs | | System Manufacturer/Model Number Gateway OS Windows 7 64 bit Home |
25 Sep 2012
|
#122 | | Windows 7 Ultimate SP1 (x64) South Australia |
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: I found this articel that explains the different dates: Quote: 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 System Specs | | Computer type PC/Desktop System Manufacturer/Model Number Golden Mk. I.3 OS Windows 7 Ultimate SP1 (x64) CPU Intel i7 860 @ 2.80 GHz Motherboard Gigabyte P55A-UD3R Rev.1. Award BIOS F13 Memory 16GB Corsair Vengance DDR3 @ 661 MHz Dual Channel (9-9-9-24) Graphics Card EVGA NVidia GTX 560 1024MB Sound Card Realtek Integrated Monitor(s) Displays Dual Samsung SyncMaster 2494HS Screen Resolution 1920*1080 and 1920*1080 Keyboard Logitech G110 Mouse Logitech MX518 PSU Thermaltake ToughPower QFan 750W Case Thermaltake Element S VK60001W2Z Cooling Corsair H60 Water Cooling, 2*230mm and 2*80mm case fans Hard Drives 1*OCZ Vertex 2 60GB SSD;
2*Samsung F3 SpinPoint 1TB in RAID0;
3*Samsung F1 SpinPoint 1TB in RAID5;
1*Western Digital 500GB External USB 3.0
1*Seagate 500GB External USB 2.0 Internet Speed Not fast enough!!! Antivirus MSE and Malwarebytes Pro Browser Chrome Version 25 Other Info Laptop: ASUS X54C, Intel Core i3-2330M @ 2.0Ghz, 4GB RAM, Intel HD on-board graphics, Windows 7 Professional SP1 (x64), LinuxMint 14 (x64), PepperMint 3 (x86) |
27 Sep 2012
|
#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 12:19 AM..
Reason: error
| My System Specs | | System Manufacturer/Model Number Gateway OS Windows 7 64 bit Home |
04 Oct 2012
|
#125 | | Windows 7 Ultimate SP1 (x64) South Australia |
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.
Regards,
Golden | My System Specs | | Computer type PC/Desktop System Manufacturer/Model Number Golden Mk. I.3 OS Windows 7 Ultimate SP1 (x64) CPU Intel i7 860 @ 2.80 GHz Motherboard Gigabyte P55A-UD3R Rev.1. Award BIOS F13 Memory 16GB Corsair Vengance DDR3 @ 661 MHz Dual Channel (9-9-9-24) Graphics Card EVGA NVidia GTX 560 1024MB Sound Card Realtek Integrated Monitor(s) Displays Dual Samsung SyncMaster 2494HS Screen Resolution 1920*1080 and 1920*1080 Keyboard Logitech G110 Mouse Logitech MX518 PSU Thermaltake ToughPower QFan 750W Case Thermaltake Element S VK60001W2Z Cooling Corsair H60 Water Cooling, 2*230mm and 2*80mm case fans Hard Drives 1*OCZ Vertex 2 60GB SSD;
2*Samsung F3 SpinPoint 1TB in RAID0;
3*Samsung F1 SpinPoint 1TB in RAID5;
1*Western Digital 500GB External USB 3.0
1*Seagate 500GB External USB 2.0 Internet Speed Not fast enough!!! Antivirus MSE and Malwarebytes Pro Browser Chrome Version 25 Other Info Laptop: ASUS X54C, Intel Core i3-2330M @ 2.0Ghz, 4GB RAM, Intel HD on-board graphics, Windows 7 Professional SP1 (x64), LinuxMint 14 (x64), PepperMint 3 (x86) |
04 Oct 2012
|
#126 | | |
That was easy. Sorry, I've installed Windows 7 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 Windows 7 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 AM..
Reason: Better understanding.
| My System Specs | | |
04 Oct 2012
|
#127 | | Windows 7 Ultimate SP1 (x64) South Australia |
I would only apply it if you need it.....setup a test run to see what happens. | My System Specs | | Computer type PC/Desktop System Manufacturer/Model Number Golden Mk. I.3 OS Windows 7 Ultimate SP1 (x64) CPU Intel i7 860 @ 2.80 GHz Motherboard Gigabyte P55A-UD3R Rev.1. Award BIOS F13 Memory 16GB Corsair Vengance DDR3 @ 661 MHz Dual Channel (9-9-9-24) Graphics Card EVGA NVidia GTX 560 1024MB Sound Card Realtek Integrated Monitor(s) Displays Dual Samsung SyncMaster 2494HS Screen Resolution 1920*1080 and 1920*1080 Keyboard Logitech G110 Mouse Logitech MX518 PSU Thermaltake ToughPower QFan 750W Case Thermaltake Element S VK60001W2Z Cooling Corsair H60 Water Cooling, 2*230mm and 2*80mm case fans Hard Drives 1*OCZ Vertex 2 60GB SSD;
2*Samsung F3 SpinPoint 1TB in RAID0;
3*Samsung F1 SpinPoint 1TB in RAID5;
1*Western Digital 500GB External USB 3.0
1*Seagate 500GB External USB 2.0 Internet Speed Not fast enough!!! Antivirus MSE and Malwarebytes Pro Browser Chrome Version 25 Other Info Laptop: ASUS X54C, Intel Core i3-2330M @ 2.0Ghz, 4GB RAM, Intel HD on-board graphics, Windows 7 Professional SP1 (x64), LinuxMint 14 (x64), PepperMint 3 (x86) |
09 Oct 2012
|
#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. | My System Specs | | |
09 Oct 2012
|
#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 System Specs | | ROBOCOPY - Create Backup Script problems? All times are GMT -5. The time now is 08:29 AM. | |