On Thu, Jan 10, 2013 at 04:01:13PM -0500, Wietse Venema wrote:
> With the option to edit master.cf will come new opportunities
> to destroy a configuration.
>
> Below is a first design for a "backup before edit" option. If no
> command is configured, then no backup will be made. If the backup
> command fails, then the postconf command will not edit the file.
>
> Wietse
>
> postconf_backup_command (default: empty)
>
> Optional external command that the postconf(1) command executes
> before it attempts to modify the main.cf or master.cf file. The
> macro "$file" is replaced by the absolute pathname of the file.
>
> Note: the command is subject to $name expansion. Specify "$$"
> to produce a single "$" character.
>
> Example:
>
> # This reuses the destination name when multiple edits are made
> # within the same second.
> backup_command = cp -p $file $file.saved.`date +%Y%m%d-%H%M%S`
I assume the backup command will run only once the appropriate lock
is acquired. The documentation should probably include an example
of use with RCS:
backup_command = ci -u -m"Automatic backup" $file
Does the command get passed to a shell or executed directly? In
either case the documentation needs to cover any quoting rules.
--
Viktor.