|
Project Information
Featured
Downloads
Links
|
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 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
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.
Running as a java applicationCommand line parametersMakeDirDiff requires three parameters and optional flags:
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 <!-- Basic Example of using makeDirDiff Ant task -->
<target name="example">
<!-- Defind required jars-->
<path id="taskDependencies">
<pathelement location="./ant.jar"/>
<pathelement location="./jsCssMin-1.0.jar"/>
<pathelement location="./makeDirDiff-1.4.jar"/>
</path>
<!-- Defind makeDirDiff Ant task -->
<taskdef name="makeDirDiff" classname="org.grenader.makedirdiff.MakeDirDiff">
<classpath refid="taskDependencies"/>
</taskdef>
<!--
Execute the makeDirDiff task
"./original" - original data directory. It's defined as a nested fileset item
"./result" - result directory. It's defined as a destDir attribute
"./previous" - previous data directory. It's defined as a prevDir attribute
"cleanDestDir - true/false, not required. If "true" result directory will be
cleaned before copying new/changed files into it.
-->
<makeDirDiff
destDir="./result"
prevDir="./previous">
<fileset dir="./original"/>
</makeDirDiff>
</target>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 |











