time. The
repeat interval defines the time between two subsequent snapshots. It is
specified by a number and a period multiplier, one of `h(our)`, `d(ay)`,
-`w(eek)`, `M(onth)` and `Y(ear)`. E.g. a repeat interval of `12h` specifies one
+`w(eek)`, `M(onth)` and `y(ear)`. E.g. a repeat interval of `12h` specifies one
snapshot every 12 hours.
The start time is specified as a time string (more details about passing times
below). By default
at least `<time period>` apart. For Example `7d` means the user wants to keep 7
snapshots that are at least one day (but potentially longer) apart from each other.
The following time periods are recognized: `h(our)`, `d(ay)`, `w(eek)`, `M(onth)`,
-`Y(ear)` and `n`. The latter is a special modifier where e.g. `10n` means keep
+`y(ear)` and `n`. The latter is a special modifier where e.g. `10n` means keep
the last 10 snapshots regardless of timing,
All subcommands take optional `fs` argument to specify paths in
test_dir = TestSnapSchedulesSnapdir.TEST_DIRECTORY + "/yearly"
self.mount_a.run_shell(['mkdir', '-p', test_dir])
- self.fs_snap_schedule_cmd('add', path=test_dir, snap_schedule='1Y')
+ self.fs_snap_schedule_cmd('add', path=test_dir, snap_schedule='1y')
test_dir = TestSnapSchedulesSnapdir.TEST_DIRECTORY + "/bad_period_spec"
self.mount_a.run_shell(['mkdir', '-p', test_dir])
return ret
-RETENTION_MULTIPLIERS = ['n', 'm', 'h', 'd', 'w', 'M', 'Y']
+RETENTION_MULTIPLIERS = ['n', 'm', 'h', 'd', 'w', 'M', 'y']
TableRowT = Dict[str, Union[int, str]]
# test to see if period and spec are valid
# this test will throw a ValueError exception if
# period is negative or zero
- # spec is empty or other than n,m,h,d,w,M,Y
+ # spec is empty or other than n,m,h,d,w,M,y
rep = self.repeat
self.retention = json.loads(retention_policy)
if start is None:
except ValueError:
raise ValueError('invalid schedule specified - period should be '
'non-zero positive value and multiplier should '
- 'be one of h,d,w,M,Y e.g. 1h or 4d etc.')
+ 'be one of h,d,w,M,y e.g. 1h or 4d etc.')
if period <= 0:
raise ValueError('invalid schedule specified - period must be a '
'non-zero positive value e.g. 1h or 4d etc.')
return period * 60 * 60 * 24 * 7
elif mult == 'M':
return period * 60 * 60 * 24 * 30
- elif mult == 'Y':
+ elif mult == 'y':
return period * 60 * 60 * 24 * 365
else:
raise ValueError('invalid schedule specified - multiplier should '
- 'be one of h,d,w,M,Y')
+ 'be one of h,d,w,M,y')
UPDATE_LAST = '''UPDATE schedules_meta
SET