Mercurial backup script

A simple cmd batch to clone and pack a mercurial repo. I used to run that just before logging off.

rmdir /S /Q repo-snap
hg clone -U repo-work repo-snap

7z a -t7z -mx=9 repo-snap-@stamp.7z repo-snap

rmdir /S /Q repo-snap
java -jar jstamper.jar repo-snap-@stamp.7z

shutdown -s -t 120


PS: jstamper.jar was a simple class which renamed file so @stamp was substed with current datestamp. Bash does that in a blink, but there's no simple way to do that in cmd.

No comments: