The basic profile example in the Unison manual introduces the $VERSION
placeholder for backups. No other placeholders are mentioned in the docs. I'm wondering if Unison provides others except $VERSION
. I'd like to see one for the current timestamp for example.
1 Answer
No, there are (currently) no other placeholder variables besides $VERSION
that you can use in Unison's backupprefix
and backupsuffix
options. And to address the comments, $VERSION
is a Unison internal value and no you cannot use environmental variables in your Unison profile.
This functionality is implemented in the Unison source in the file stasher.ml
, in case you were feeling up to writing this feature yourself. Otherwise I think you could just accomplish what you want with a shell script. You could write a script that watches your backupdir
specified in your Unison profile with something from inotifytools
, and anytime a new FILE
is created in the directory, rename it to $(date).FILE
or something.
$VERSION
only is available in certain fields. So seemed to me it is something replaced by Unison with an internal value.