shadow_copy2: allow configurable prefix for snapshot name
commit71682e125c840225a25b21810119e20c96fd85d8
authorRajesh Joseph <rjoseph@redhat.com>
Wed, 13 Jul 2016 18:59:18 +0000 (13 18:59 +0000)
committerStefan Metzmacher <metze@samba.org>
Thu, 28 Jul 2016 08:06:13 +0000 (28 10:06 +0200)
treeb1159e5313fe921d460b879881ab80e490bee080
parentc9b6e99ee17427138524b0ce676d720459ed23c3
shadow_copy2: allow configurable prefix for snapshot name

With growing number of snapshots file-systems need some mechanism
to differentiate one set of snapshots from other, e.g. monthly, weekly,
manual, special events, etc. Therefore these file-systems provide
different ways to tag snapshots, e.g. provide a configurable way to
name snapshots, which is not just based on time. With only shadow:format
it is very difficult to filter these snapshots.

As part of this change added two new options, shadow:snapprefix and
shadow:delimiter, in shadow_copy2 config. This option will accept regular
expression (BRE) as input. With this optional parameter, one can specify a
variable prefix component for names of the snapshot directories in the
file-system. If this parameter is set, together with the shadow:format and
shadow:delimiter parameters it determines the possible names of snapshot
directories in the file-system.

e.g.
shadow:snapprefix = [a-z]*[0-9]

When this option is provided then shadow:format option should always
start with <delimiter> string. This delimiter is configurable via a new option,
i.e. shadow:delimiter. Default value for this is "_GMT",
e.g. _GMT-%Y.%m.%d-%H.%M.%S

Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/modules/vfs_shadow_copy2.c