

Ant Task サンプル 日付・時刻(例:200402010130)でデーターをbackupする
データーを特定の時刻の状態でバックアップしたいということはないでしょうか。
そういう時以下のようにしています。お好みで、時刻をなしにしたり、project名を削ったりするのもいいと思います。
このサンプルはmacrodef形式になっています。
<macrodef name="zipbackup"> <attribute name="targetDir"/> <attribute name="tmpDir" default="tmp"/> <attribute name="projectName" default="backup"/> <sequential> <mkdir dir="@{tmpDir}"/> <tstamp></tstamp> <copy todir="@{tmpDir}"> <fileset dir="@{targetDir}"> </fileset> </copy> <zip zipfile="@{projectName}_${DSTAMP}_${TSTAMP}.zip" basedir="@{tmpDir}"/> <delete dir="@{tmpDir}"/> </sequential> </macrodef>

