0

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
  • @Rinzwind Are you sure Unison makes environment variables available within the profile? The docs mention that$VERSION only is available in certain fields. So seemed to me it is something replaced by Unison with an internal value.
    – magic_al
    Jun 30, 2016 at 10:59

1 Answer 1

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .