I'm trying to create backups of files we are getting from a client. They come to us like fileABC1000I. We have an ANT script that manipulates the data but before this within in the same script I want to backup the file with a timestamp in the filename. The programmer that developed the ant script isn't around anymore. To test this out I created a small ant script (that doesn't work);
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="bak">
<property file="conf/build.properties" />
<property file="conf/user.properties" />
<target name="bak">
<tstamp/>
<move file="ImportNEW/fileABC1*" tofile="ImportNEW/backup/fileABC1{$DSTAMP}.BAK"/>
<move file="ImportNEW/fileABC2*" tofile="ImportNEW/backup/fileABC2{$DSTAMP}.BAK"/>
<move file="ImportNEW/fileABC3*" tofile="ImportNEW/backup/fileABC3{$DSTAMP}.BAK"/>
<move file="ImportNEW/fileABC4*" tofile="ImportNEW/backup/fileABC4{$DSTAMP}.BAK"/>
</target>
</project>
I think I'm on the right track but it's not working? Can someone help?
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="bak">
<property file="conf/build.properties" />
<property file="conf/user.properties" />
<target name="bak">
<tstamp/>
<move file="ImportNEW/fileABC1*" tofile="ImportNEW/backup/fileABC1{$DSTAMP}.BAK"/>
<move file="ImportNEW/fileABC2*" tofile="ImportNEW/backup/fileABC2{$DSTAMP}.BAK"/>
<move file="ImportNEW/fileABC3*" tofile="ImportNEW/backup/fileABC3{$DSTAMP}.BAK"/>
<move file="ImportNEW/fileABC4*" tofile="ImportNEW/backup/fileABC4{$DSTAMP}.BAK"/>
</target>
</project>
I think I'm on the right track but it's not working? Can someone help?