2/19/2023 0 Comments Xcopy to compare folders![]() ![]() ![]() It was built to be more robust (hence the name) than Xcopy or the original copy command. It is a favorite amongst many IT Pros, mostly due to its overwhelming number of useful features and switches. Robocopy stands for “Robust File Copy.” It is a powerful (and potentially scary) command-line utility to copy or move files from one place to another. Deduplicated files (Windows Server 2016 and higher).How to monitor backups with Robocopy /mon and /mot.Synchronizing files and folders with Robocopy /mir.Selecting files by modification date with Robocopy /maxage.Selecting files by file size using Robocopy /max.Moving files and folders with Robocopy /move.How to include subfolders with Robocopy /e.Copying files and folders with Robocopy.And fc unfortunately is an external command (like tree). ) to deal with this problem, but they are working ONLY WITH INTERNAL COMMANDS (like dir), not with external commands. What is the essential point to understand why SourArray.HasKey(.) is so much faster than something like IfInString(.)?Ī note to the DOS command fc (file compare): I was able to use it for this purpose, but at the end I discovered a fundamental problem.įc /u file1 file2 > comp.txt always generates an ANSI encoded file (meaning that it can not be used in scenarios with foreign language characters in file names)! The screen output of fc itself is correct (Unicode), the problem is the redirection to file. I hardly understand the method, but it is really extremely fast. I am now testing if the fc command can be used for my purpose (but this question is now already me: THIS IS SIMPLY PHANTASTIC! Thank you very much! The problem was that xcopy was not copying hidden files. This was a mistake and a misinterpretation. Maybe somebody here knows if these limitations can be neutralized somehow? And there is maybe a limitation to the number of lines to (?). This compares my file-list files extremely fast and (after some modifications of comp.txt) maybe would enable me to generate a clean list of deleted files.īut unfortunately there seems to be a limitation to the line length in the txt files compared: In my tests a 150 character line is not processed correctly (and a difference between two files is indicated). In the meantime I discovered a DOS command which theoretically would solve my problem: Yes, robocopy would be fine, but unfortunately it is not a standard component of Windows XP (and I would like that my script can be used by Windows XP users too.). Is there a way to shorten this time to an acceptable Thank you very much. In a scenario with 10 GB this would mean that the "zero" backup process is finished in 3 min only, but the process to find out that there are no files deleted since last backup would take additional 13 min! In the above mentioned scenario (both folders are identical), this last part of the mirror-backup process would take a multiple of time needed for the backup itself (150 vs. I tested some options, but all of them are extremely slow. So I have to use AHK methods to compare both file lists. Using these DOS commands seems to be faster than every AHK method! This process is extremely fast too: It takes only 4 seconds (for both lists!). I am using this to generate file lists for Source and Mirror. However, there is a DOS method to generate file lists: As far as I know there is no DOS method to compare the content of folders. The process is extremely fast: The "zero" backup takes only 36 seconds.īoth folders must be compared to find those files in Mirror which has been deleted in Source since last backup. This copies only files from Source to Mirror which have been changed since last backup (or are not present in Mirror). I am using the following two DOS commands:ġ) xcopy C:\Source\*.* D:\Mirror /s /d /y /k /r /i So "zero" means that zero files would have to be copied during the backup process, and zero files would have to be deleted in Mirror because they have been deleted in Source since last backup. I have a C:\Source containing approx 20.000 files, 2 GB, and a D:\Mirror with identical content. I am testing my mirror-backup AHK script in the folowing "zero" scenario: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |