I can provide an indirect answer via arara. :)
This rule might do exactly what you want (untested on Windows, but I believe it works):
!config
identifier: renamer
name: Renamer
commands:
- <arara> @{isWindows("cmd /c rename", "mv")} "@{getBasename(file)}.pdf" "@{getBasename(file)}_@{date.concat(version)}.pdf"
arguments:
- identifier: date
default: <arara> @{(new java.text.SimpleDateFormat("yyyy-MM-dd")).format(new java.util.Date())}
- identifier: version
flag: <arara> @{"_".concat(parameters.version)}
I opted for the yyyy-MM-dd pattern, but this can be easily changed. :) The idea here is:
- Get
foo.pdf.
- Get the current date (e.g,
2014-03-26).
- Append the date to the filename.
- If any version provided via directive, append it as well.
???
- Profit.
:)
A quick example:
% arara: pdftex
% arara: renamer
Hello world!
\bye
Running arara:
paulo@alexandria paulo$ ls
vtest.tex
paulo@alexandria paulo$ arara vtest.tex
__ _ _ __ __ _ _ __ __ _
/ _` | '__/ _` | '__/ _` |
| (_| | | | (_| | | | (_| |
\__,_|_| \__,_|_| \__,_|
Running PDFTeX... SUCCESS
Running Renamer... SUCCESS
paulo@alexandria paulo$ ls
vtest_2014-03-26.pdf vtest.log vtest.tex
If I want to append a version ID:
% arara: pdftex
% arara: renamer: { version: 'draft' }
Hello world!
\bye
And now:
paulo@alexandria paulo$ arara vtest.tex
__ _ _ __ __ _ _ __ __ _
/ _` | '__/ _` | '__/ _` |
| (_| | | | (_| | | | (_| |
\__,_|_| \__,_|_| \__,_|
Running PDFTeX... SUCCESS
Running Renamer... SUCCESS
paulo@alexandria paulo$ ls
vtest_2014-03-26_draft.pdf vtest_2014-03-26.pdf vtest.log vtest.tex
There we go! :)