Make Directory Difference (MakeDirDiff) tool
Русский: Описание проекта MakeDirDiff
IntroductionMakeDirDiff is a simple command line tool for finding differences between two directories and storing all new/updates files in a new directory.
MakeDirDiff compares two
... [More]
directories and creates the third directory with the first directory structure, but with new or updated files only. It can update the second directory content with the current content of the first directory. On the next run MakeDirDiff will find and place only new/changed files appeared in the first directory into the third directory
Look at the MakeDirDiff.gif picture to get a visual notion about MakeDirDiff data flow.
It's an Apache Ant task.
I found this extremely useful for creating incremental backups and updating big web-sites.
How it can be runIt is a simple java application, designed as an Apache Ant task.
MakeDirDiff can be
run from the command line, run as a single Ant task, used as a part of other Ant tasks or integrated into other applications like a library as well.
System RequirementsTroubleshootingExecuting a sample ANT taskWe will run and analyze the sample ant task that is stored in build.xml file in each makeDirDiff-bin-1.x.zip file.
Download makeDirDiff-bin-1.x.zip file from the Project Download page. Extract this archive to a directory. If you wish more details, look into 'build.xml' file to get some information about a way the example Ant task is defined there, otherwise skip this step. Go to this directory and run an 'ant' command using a system command line interface. You will see some output and words 'BUILD SUCCESSFUL' at the end. In this case the provided MakeDirDiff example works fine. This example task creates a 'result' directory and copy there all files from 'original' directory. It also stores an 'original' directory content into the 'previous' directory. Something has gone wrong when you don't see 'BUILD SUCCESSFUL' words. Look at the 'Troubleshooting' chapter here to find out what is your problem. That’s it! MakeDirDiff made a copy of new/updates files from the ‘original’ directory for you. Let’s try to make something more difficult. Please, remove the 'result' directory now and run 'ant' command again. You will see that the 'result' directory is created again, but it's empty. This is because it has only new/updated files and directories from the 'original' directory, which have not been changed. Make a small experiment then. Add some files and directories into the 'original' directory and run the 'ant' command again. The 'result' directory will contain all those new files and directories. It works! Running as a java applicationCommand line parametersMakeDirDiff requires three parameters:
Note that MakeDirDiff without parameters or with wrong number of parameters shows this help text.
MS Windows command examplejava -cp *; org.grenader.makedirdiff.MakeDirDiff ./original ./result ./previous You can find this command in the makeDirDiff-Example.bat in makeDirDiff-bin-1.x.zip archive
Unix command examplejava -cp *: org.grenader.makedirdiff.MakeDirDiff ./original ./result ./previous You can find this command in the makeDirDiff-Example.sh in makeDirDiff-bin-1.x.zip archive
Example ANT taskThe following Ant task is stored in build.xml file in each makeDirDiff-bin-1.x.zip file
Look at other examples of calling MakeDirDiff from Ant
FeaturesLicenseMakeDirDiff is released under the Apache Software License. See LICENSE.txt for more details.
How to contributeAcknowledgementsI'd like to thank Dmitry Solomadin who was so kind and smart to invent a name of the MakeDirDiff tool for me.
Links [Less]