API documentation¶
This documentation is based on the source code of version 8.1 of the rotate-backups package. The following modules are available:
rotate_backups
¶
Simple to use Python API for rotation of backups.
The rotate_backups
module contains the Python API of the
rotate-backups package. The core logic of the package is contained in the
RotateBackups
class.
-
rotate_backups.
DEFAULT_REMOVAL_COMMAND
= ['rm', '-fR']¶ The default removal command (a list of strings).
-
rotate_backups.
ORDERED_FREQUENCIES
= (('minutely', relativedelta(minutes=+1)), ('hourly', relativedelta(hours=+1)), ('daily', relativedelta(days=+1)), ('weekly', relativedelta(days=+7)), ('monthly', relativedelta(months=+1)), ('yearly', relativedelta(years=+1)))¶ An iterable of tuples with two values each:
- The name of a rotation frequency (a string like ‘hourly’, ‘daily’, etc.).
- A
relativedelta
object.
The tuples are sorted by increasing delta (intentionally).
-
rotate_backups.
SUPPORTED_DATE_COMPONENTS
= (('year', True), ('month', True), ('day', True), ('hour', False), ('minute', False), ('second', False))¶ An iterable of tuples with two values each:
-
rotate_backups.
SUPPORTED_FREQUENCIES
= {'daily': relativedelta(days=+1), 'hourly': relativedelta(hours=+1), 'minutely': relativedelta(minutes=+1), 'monthly': relativedelta(months=+1), 'weekly': relativedelta(days=+7), 'yearly': relativedelta(years=+1)}¶ A dictionary with rotation frequency names (strings) as keys and
relativedelta
objects as values. This dictionary is generated based on the tuples inORDERED_FREQUENCIES
.
-
rotate_backups.
TIMESTAMP_PATTERN
= <_sre.SRE_Pattern object>¶ A compiled regular expression object used to match timestamps encoded in filenames.
-
rotate_backups.
coerce_location
(value, **options)[source]¶ Coerce a string to a
Location
object.Parameters: - value – The value to coerce (a string or
Location
object). - options – Any keyword arguments are passed on to
create_context()
.
Returns: A
Location
object.- value – The value to coerce (a string or
-
rotate_backups.
coerce_retention_period
(value)[source]¶ Coerce a retention period to a Python value.
Parameters: value – A string containing the text ‘always’, a number or an expression that can be evaluated to a number. Returns: A number or the string ‘always’. Raises: ValueError
when the string can’t be coerced.
-
rotate_backups.
load_config_file
(configuration_file=None, expand=True)[source]¶ Load a configuration file with backup directories and rotation schemes.
Parameters: Returns: A generator of tuples with four values each:
- An execution context created using
executor.contexts
. - The pathname of a directory with backups (a string).
- A dictionary with the rotation scheme.
- A dictionary with additional options.
Raises: ValueError
when configuration_file is given but doesn’t exist or can’t be loaded.This function is used by
RotateBackups
to discover user defined rotation schemes and byrotate_backups.cli
to discover directories for which backup rotation is configured. When configuration_file isn’t givenConfigLoader
is used to search for configuration files in the following locations:/etc/rotate-backups.ini
and/etc/rotate-backups.d/*.ini
~/.rotate-backups.ini
and~/.rotate-backups.d/*.ini
~/.config/rotate-backups.ini
and~/.config/rotate-backups.d/*.ini
All of the available configuration files are loaded in the order given above, so that sections in user-specific configuration files override sections by the same name in system-wide configuration files.
- An execution context created using
-
rotate_backups.
rotate_backups
(directory, rotation_scheme, **options)[source]¶ Rotate the backups in a directory according to a flexible rotation scheme.
Note
This function exists to preserve backwards compatibility with older versions of the rotate-backups package where all of the logic was exposed as a single function. Please refer to the documentation of the
RotateBackups
initializer and therotate_backups()
method for an explanation of this function’s parameters.
-
class
rotate_backups.
RotateBackups
(rotation_scheme, **options)[source]¶ Python API for the
rotate-backups
program.Here’s an overview of the
RotateBackups
class:Superclass: PropertyManager
Special methods: __init__()
Public methods: apply_rotation_scheme()
,collect_backups()
,find_preservation_criteria()
,group_backups()
,load_config_file()
,match_to_datetime()
,rotate_backups()
androtate_concurrent()
Properties: config_file
,dry_run
,exclude_list
,force
,include_list
,io_scheduling_class
,prefer_recent
,removal_command
,rotation_scheme
,strict
andtimestamp_pattern
When you initialize a
RotateBackups
object you are required to provide a value for therotation_scheme
property. You can set the values of theconfig_file
,dry_run
,exclude_list
,force
,include_list
,io_scheduling_class
,prefer_recent
,removal_command
,rotation_scheme
,strict
andtimestamp_pattern
properties by passing keyword arguments to the class initializer.-
__init__
(rotation_scheme, **options)[source]¶ Initialize a
RotateBackups
object.Parameters: - rotation_scheme – Used to set
rotation_scheme
. - options – Any keyword arguments are used to set the values of
instance properties that support assignment
(
config_file
,dry_run
,exclude_list
,include_list
,io_scheduling_class
,removal_command
andstrict
).
- rotation_scheme – Used to set
-
config_file
[source]¶ The pathname of a configuration file (a string or
None
).When this property is set
rotate_backups()
will useload_config_file()
to give the user (operator) a chance to set the rotation scheme and other options via a configuration file.Note
The
config_file
property is amutable_property
. You can change the value of this property using normal attribute assignment syntax. To reset it to its default (computed) value you can usedel
ordelattr()
.
-
dry_run
[source]¶ True
to simulate rotation,False
to actually remove backups (defaults toFalse
).If this is
True
thenrotate_backups()
won’t make any actual changes, which provides a ‘preview’ of the effect of the rotation scheme. Right now this is only useful in the command line interface because there’s no return value.Note
The
dry_run
property is amutable_property
. You can change the value of this property using normal attribute assignment syntax. To reset it to its default (computed) value you can usedel
ordelattr()
.
-
exclude_list
[source]¶ Filename patterns to exclude specific backups (a list of strings).
This is a list of strings with
fnmatch
patterns. Whencollect_backups()
encounters a backup whose name matches any of the patterns in this list the backup will be ignored, even if it also matches the include list (it’s the only logical way to combine both lists).See also: include_list
Note
The
exclude_list
property is acustom_property
. You can change the value of this property using normal attribute assignment syntax. This property’s value is computed once (the first time it is accessed) and the result is cached. To clear the cached value you can usedel
ordelattr()
.
-
force
[source]¶ True
to continue if sanity checks fail,False
to raise an exception.Sanity checks are performed before backup rotation starts to ensure that the given location exists, is readable and is writable. If
removal_command
is customized then the last sanity check (that the given location is writable) is skipped (because custom removal commands imply custom semantics, see also #18). If a sanity check fails an exception is raised, but you can setforce
toTrue
to continue with backup rotation instead (the default is obviouslyFalse
).Note
The
force
property is amutable_property
. You can change the value of this property using normal attribute assignment syntax. To reset it to its default (computed) value you can usedel
ordelattr()
.
-
include_list
[source]¶ Filename patterns to select specific backups (a list of strings).
This is a list of strings with
fnmatch
patterns. When it’s not emptycollect_backups()
will only collect backups whose name matches a pattern in the list.See also: exclude_list
Note
The
include_list
property is acustom_property
. You can change the value of this property using normal attribute assignment syntax. This property’s value is computed once (the first time it is accessed) and the result is cached. To clear the cached value you can usedel
ordelattr()
.
-
io_scheduling_class
[source]¶ The I/O scheduling class for backup rotation (a string or
None
).When this property is set (and
have_ionice
isTrue
) then ionice will be used to set the I/O scheduling class for backup rotation. This can be useful to reduce the impact of backup rotation on the rest of the system.The value of this property is expected to be one of the strings ‘idle’, ‘best-effort’ or ‘realtime’.
Note
The
io_scheduling_class
property is amutable_property
. You can change the value of this property using normal attribute assignment syntax. To reset it to its default (computed) value you can usedel
ordelattr()
.
-
prefer_recent
[source]¶ Whether to prefer older or newer backups in each time slot (a boolean).
Defaults to
False
which means the oldest backup in each time slot (an hour, a day, etc.) is preserved while newer backups in the time slot are removed. You can set this toTrue
if you would like to preserve the newest backup in each time slot instead.Note
The
prefer_recent
property is amutable_property
. You can change the value of this property using normal attribute assignment syntax. To reset it to its default (computed) value you can usedel
ordelattr()
.
-
removal_command
[source]¶ The command used to remove backups (a list of strings).
By default the command
rm -fR
is used. This choice was made because it works regardless of whether the user’s “backups to be rotated” are files or directories or a mixture of both.Note
The
removal_command
property is amutable_property
. You can change the value of this property using normal attribute assignment syntax. To reset it to its default (computed) value you can usedel
ordelattr()
.
-
rotation_scheme
[source]¶ The rotation scheme to apply to backups (a dictionary).
Each key in this dictionary defines a rotation frequency (one of the strings ‘minutely’, ‘hourly’, ‘daily’, ‘weekly’, ‘monthly’ and ‘yearly’) and each value defines a retention count:
- An integer value represents the number of backups to preserve in the given rotation frequency, starting from the most recent backup and counting back in time.
- The string ‘always’ means all backups in the given rotation frequency are preserved (this is intended to be used with the biggest frequency in the rotation scheme, e.g. yearly).
No backups are preserved for rotation frequencies that are not present in the dictionary.
Note
The
rotation_scheme
property is arequired_property
. You are required to provide a value for this property by calling the constructor of the class that defines the property with a keyword argument named rotation_scheme (unless a custom constructor is defined, in this case please refer to the documentation of that constructor). You can change the value of this property using normal attribute assignment syntax.
-
strict
[source]¶ Whether to enforce the time window for each rotation frequency (a boolean, defaults to
True
).The easiest way to explain the difference between strict and relaxed rotation is using an example:
- If
strict
isTrue
and the number of hourly backups to preserve is three, only backups created in the relevant time window (the hour of the most recent backup and the two hours leading up to that) will match the hourly frequency. - If
strict
isFalse
then the three most recent backups will all match the hourly frequency (and thus be preserved), regardless of the calculated time window.
If the explanation above is not clear enough, here’s a simple way to decide whether you want to customize this behavior:
- If your backups are created at regular intervals and you never miss
an interval then the default (
True
) is most likely fine. - If your backups are created at irregular intervals then you may want
to set
strict
toFalse
to convinceRotateBackups
to preserve more backups.
Note
The
strict
property is amutable_property
. You can change the value of this property using normal attribute assignment syntax. To reset it to its default (computed) value you can usedel
ordelattr()
.- If
-
timestamp_pattern
[source]¶ The pattern used to extract timestamps from filenames (defaults to
TIMESTAMP_PATTERN
).The value of this property is a compiled regular expression object. Callers can provide their own compiled regular expression which makes it possible to customize the compilation flags (see the
re.compile()
documentation for details).The regular expression pattern is expected to be a Python compatible regular expression that defines the named capture groups ‘year’, ‘month’ and ‘day’ and optionally ‘hour’, ‘minute’ and ‘second’.
String values are automatically coerced to compiled regular expressions by calling
coerce_pattern()
, in this case only there.VERBOSE
flag is used.If the caller provides a custom pattern it will be validated to confirm that the pattern contains named capture groups corresponding to each of the required date components defined by
SUPPORTED_DATE_COMPONENTS
.Note
The
timestamp_pattern
property is amutable_property
. You can change the value of this property using normal attribute assignment syntax. To reset it to its default (computed) value you can usedel
ordelattr()
.
-
rotate_concurrent
(*locations, **kw)[source]¶ Rotate the backups in the given locations concurrently.
Parameters: - locations – One or more values accepted by
coerce_location()
. - kw – Any keyword arguments are passed on to
rotate_backups()
.
This function uses
rotate_backups()
to prepare rotation commands for the given locations and then it removes backups in parallel, one backup per mount point at a time.The idea behind this approach is that parallel rotation is most useful when the files to be removed are on different disks and so multiple devices can be utilized at the same time.
Because mount points are per system
rotate_concurrent()
will also parallelize over backups located on multiple remote systems.- locations – One or more values accepted by
-
rotate_backups
(location, load_config=True, prepare=False)[source]¶ Rotate the backups in a directory according to a flexible rotation scheme.
Parameters: - location – Any value accepted by
coerce_location()
. - load_config – If
True
(so by default) the rotation scheme and other options can be customized by the user in a configuration file. In this case the caller’s arguments are only used when the configuration file doesn’t define a configuration for the location. - prepare – If this is
True
(not the default) thenrotate_backups()
will prepare the required rotation commands without running them.
Returns: A list with the rotation commands (
ExternalCommand
objects).Raises: ValueError
when the given location doesn’t exist, isn’t readable or isn’t writable. The third check is only performed when dry run isn’t enabled.This function binds the main methods of the
RotateBackups
class together to implement backup rotation with an easy to use Python API. If you’re using rotate-backups as a Python API and the default behavior is not satisfactory, consider writing your ownrotate_backups()
function based on the underlyingcollect_backups()
,group_backups()
,apply_rotation_scheme()
andfind_preservation_criteria()
methods.- location – Any value accepted by
-
load_config_file
(location)[source]¶ Load a rotation scheme and other options from a configuration file.
Parameters: location – Any value accepted by coerce_location()
.Returns: The configured or given Location
object.
-
collect_backups
(location)[source]¶ Collect the backups at the given location.
Parameters: location – Any value accepted by coerce_location()
.Returns: A sorted list
ofBackup
objects (the backups are sorted by their date).Raises: ValueError
when the given directory doesn’t exist or isn’t readable.
-
match_to_datetime
(match)[source]¶ Convert a regular expression match to a
datetime
value.Parameters: match – A regular expression match object. Returns: A datetime
value.Raises: exceptions.ValueError
when a required date component is not captured by the pattern, the captured value is an empty string or the captured value cannot be interpreted as a base-10 integer.See also
-
group_backups
(backups)[source]¶ Group backups collected by
collect_backups()
by rotation frequencies.Parameters: backups – A set
ofBackup
objects.Returns: A dict
whose keys are the names of rotation frequencies (‘hourly’, ‘daily’, etc.) and whose values are dictionaries. Each nested dictionary contains lists ofBackup
objects that are grouped together because they belong into the same time unit for the corresponding rotation frequency.
-
apply_rotation_scheme
(backups_by_frequency, most_recent_backup)[source]¶ Apply the user defined rotation scheme to the result of
group_backups()
.Parameters: - backups_by_frequency – A
dict
in the format generated bygroup_backups()
. - most_recent_backup – The
datetime
of the most recent backup.
Raises: ValueError
when the rotation scheme dictionary is empty (this would cause all backups to be deleted).Note
This method mutates the given data structure by removing all backups that should be removed to apply the user defined rotation scheme.
- backups_by_frequency – A
-
find_preservation_criteria
(backups_by_frequency)[source]¶ Collect the criteria used to decide which backups to preserve.
Parameters: backups_by_frequency – A dict
in the format generated bygroup_backups()
which has been processed byapply_rotation_scheme()
.Returns: A dict
withBackup
objects as keys andlist
objects containing strings (rotation frequencies) as values.
-
-
class
rotate_backups.
Location
(**kw)[source]¶ Location
objects represent a root directory containing backups.Here’s an overview of the
Location
class:Superclass: PropertyManager
Special methods: __str__()
Public methods: add_hints()
,ensure_exists()
,ensure_readable()
,ensure_writable()
andmatch()
Properties: context
,directory
,have_ionice
,have_wildcards
,is_remote
,key_properties
,mount_point
andssh_alias
When you initialize a
Location
object you are required to provide values for thecontext
anddirectory
properties. You can set the values of thecontext
anddirectory
properties by passing keyword arguments to the class initializer.-
context
[source]¶ An execution context created using
executor.contexts
.Note
The
context
property is arequired_property
. You are required to provide a value for this property by calling the constructor of the class that defines the property with a keyword argument named context (unless a custom constructor is defined, in this case please refer to the documentation of that constructor). You can change the value of this property using normal attribute assignment syntax.
-
directory
[source]¶ The pathname of a directory containing backups (a string).
Note
The
directory
property is arequired_property
. You are required to provide a value for this property by calling the constructor of the class that defines the property with a keyword argument named directory (unless a custom constructor is defined, in this case please refer to the documentation of that constructor). You can change the value of this property using normal attribute assignment syntax.
-
have_ionice
[source]¶ True
when ionice is available,False
otherwise.Note
The
have_ionice
property is alazy_property
. This property’s value is computed once (the first time it is accessed) and the result is cached.
-
have_wildcards
[source]¶ True
ifdirectory
is a filename pattern,False
otherwise.Note
The
have_wildcards
property is alazy_property
. This property’s value is computed once (the first time it is accessed) and the result is cached.
-
mount_point
[source]¶ The pathname of the mount point of
directory
(a string orNone
).If the
stat --format=%m ...
command that is used to determine the mount point fails, the value of this property defaults toNone
. This enables graceful degradation on e.g. Mac OS X whosestat
implementation is rather bare bones compared to GNU/Linux.Note
The
mount_point
property is alazy_property
. This property’s value is computed once (the first time it is accessed) and the result is cached.
-
is_remote
[source]¶ True
if the location is remote,False
otherwise.Note
The
is_remote
property is alazy_property
. This property’s value is computed once (the first time it is accessed) and the result is cached.
-
ssh_alias
[source]¶ The SSH alias of a remote location (a string or
None
).Note
The
ssh_alias
property is alazy_property
. This property’s value is computed once (the first time it is accessed) and the result is cached.
-
key_properties
¶ A list of strings with the names of the
key
properties.Overrides
key_properties
to customize the ordering ofLocation
objects so that they are ordered first by theirssh_alias
and second by theirdirectory
.
-
ensure_exists
(override=False)[source]¶ Sanity check that the location exists.
Parameters: override – True
to log a message,False
to raise an exception (when the sanity check fails).Returns: True
if the sanity check succeeds,False
if it fails (and override isTrue
).Raises: ValueError
when the sanity check fails and override isFalse
.See also
-
ensure_readable
(override=False)[source]¶ Sanity check that the location exists and is readable.
Parameters: override – True
to log a message,False
to raise an exception (when the sanity check fails).Returns: True
if the sanity check succeeds,False
if it fails (and override isTrue
).Raises: ValueError
when the sanity check fails and override isFalse
.See also
-
ensure_writable
(override=False)[source]¶ Sanity check that the directory exists and is writable.
Parameters: override – True
to log a message,False
to raise an exception (when the sanity check fails).Returns: True
if the sanity check succeeds,False
if it fails (and override isTrue
).Raises: ValueError
when the sanity check fails and override isFalse
.See also
-
add_hints
(message)[source]¶ Provide hints about failing sanity checks.
Parameters: message – The message to the user (a string). Returns: The message including hints (a string). When superuser privileges aren’t being used a hint about the
--use-sudo
option will be added (in case a sanity check failed because we don’t have permission to one of the parent directories).In all cases a hint about the
--force
option is added (in case the sanity checks themselves are considered the problem, which is obviously up to the operator to decide).See also
-
-
class
rotate_backups.
Backup
(**kw)[source]¶ Backup
objects represent a rotation subject.Here’s an overview of the
Backup
class:Superclass: PropertyManager
Special methods: __getattr__()
Properties: pathname
,timestamp
andweek
When you initialize a
Backup
object you are required to provide values for thepathname
andtimestamp
properties. You can set the values of thepathname
andtimestamp
properties by passing keyword arguments to the class initializer.-
key_properties
= ('timestamp', 'pathname')¶ Customize the ordering of
Backup
objects.Backup
objects are ordered first by theirtimestamp
and second by theirpathname
. This class variable overrideskey_properties
.
-
pathname
[source]¶ The pathname of the backup (a string).
Note
The
pathname
property is akey_property
. You are required to provide a value for this property by calling the constructor of the class that defines the property with a keyword argument named pathname (unless a custom constructor is defined, in this case please refer to the documentation of that constructor). Once this property has been assigned a value you are not allowed to assign a new value to the property.
-
timestamp
[source]¶ The date and time when the backup was created (a
datetime
object).Note
The
timestamp
property is akey_property
. You are required to provide a value for this property by calling the constructor of the class that defines the property with a keyword argument named timestamp (unless a custom constructor is defined, in this case please refer to the documentation of that constructor). Once this property has been assigned a value you are not allowed to assign a new value to the property.
-
rotate_backups.cli
¶
Usage: rotate-backups [OPTIONS] [DIRECTORY, ..]
Easy rotation of backups based on the Python package by the same name.
To use this program you specify a rotation scheme via (a combination of) the
--hourly
, --daily
, --weekly
, --monthly
and/or --yearly
options and the
directory (or directories) containing backups to rotate as one or more
positional arguments.
You can rotate backups on a remote system over SSH by prefixing a DIRECTORY with an SSH alias and separating the two with a colon (similar to how rsync accepts remote locations).
Instead of specifying directories and a rotation scheme on the command line you
can also add them to a configuration file. For more details refer to the online
documentation (see also the --config
option).
Please use the --dry-run
option to test the effect of the specified rotation
scheme before letting this program loose on your precious backups! If you don’t
test the results using the dry run mode and this program eats more backups than
intended you have no right to complain ;-).
Supported options:
Option | Description |
---|---|
-M , --minutely=COUNT |
In a literal sense this option sets the number of “backups per minute” to
preserve during rotation. For most use cases that doesn’t make a lot of
sense :-) but you can combine the --minutely and --relaxed options to
preserve more than one backup per hour. Refer to the usage of the -H ,
--hourly option for details about COUNT . |
-H , --hourly=COUNT |
Set the number of hourly backups to preserve during rotation:
|
-d , --daily=COUNT |
Set the number of daily backups to preserve during rotation. Refer to the
usage of the -H , --hourly option for details about COUNT . |
-w , --weekly=COUNT |
Set the number of weekly backups to preserve during rotation. Refer to the
usage of the -H , --hourly option for details about COUNT . |
-m , --monthly=COUNT |
Set the number of monthly backups to preserve during rotation. Refer to the
usage of the -H , --hourly option for details about COUNT . |
-y , --yearly=COUNT |
Set the number of yearly backups to preserve during rotation. Refer to the
usage of the -H , --hourly option for details about COUNT . |
-t , --timestamp-pattern=PATTERN |
Customize the regular expression pattern that is used to match and extract
timestamps from filenames. PATTERN is expected to be a Python compatible
regular expression that must define the named capture groups ‘year’,
‘month’ and ‘day’ and may define ‘hour’, ‘minute’ and ‘second’. |
-I , --include=PATTERN |
Only process backups that match the shell pattern given by PATTERN . This
argument can be repeated. Make sure to quote PATTERN so the shell doesn’t
expand the pattern before it’s received by rotate-backups. |
-x , --exclude=PATTERN |
Don’t process backups that match the shell pattern given by PATTERN . This
argument can be repeated. Make sure to quote PATTERN so the shell doesn’t
expand the pattern before it’s received by rotate-backups. |
-j , --parallel |
Remove backups in parallel, one backup per mount point at a time. The idea behind this approach is that parallel rotation is most useful when the files to be removed are on different disks and so multiple devices can be utilized at the same time. Because mount points are per system the |
-p , --prefer-recent |
By default the first (oldest) backup in each time slot is preserved. If you’d prefer to keep the most recent backup in each time slot instead then this option is for you. |
-r , --relaxed |
By default the time window for each rotation scheme is enforced (this is
referred to as strict rotation) but the
If the explanation above is not clear enough, here’s a simple way to decide whether you want to customize this behavior or not:
|
-i , --ionice=CLASS |
Use the “ionice” program to set the I/O scheduling class and priority of
the “rm” invocations used to remove backups. CLASS is expected to be one of
the values “idle” (3), “best-effort” (2) or “realtime” (1). Refer to the
man page of the “ionice” program for details about these values. The
numeric values are required by the ‘busybox’ implementation of ‘ionice’. |
-c , --config=FILENAME |
Load configuration from
Any available configuration files are loaded in the order given above, so that sections in user-specific configuration files override sections by the same name in system-wide configuration files. For more details refer to the online documentation. |
-C , --removal-command=CMD |
Change the command used to remove backups. The value of As an example of why you might want to change this, CephFS snapshots are represented as regular directory trees that can be deleted at once with a single ‘rmdir’ command (even though according to POSIX semantics this command should refuse to remove nonempty directories, but I digress). |
-u , --use-sudo |
Enable the use of “sudo” to rotate backups in directories that are not readable and/or writable for the current user (or the user logged in to a remote system over SSH). |
-S , --syslog=CHOICE |
Explicitly enable or disable system logging instead of letting the program figure out what to do. The values ‘1’, ‘yes’, ‘true’ and ‘on’ enable system logging whereas the values ‘0’, ‘no’, ‘false’ and ‘off’ disable it. |
-f , --force |
If a sanity check fails an error is reported and the program aborts. You
can use --force to continue with backup rotation instead. Sanity checks
are done to ensure that the given DIRECTORY exists, is readable and is
writable. If the --removal-command option is given then the last sanity
check (that the given location is writable) is skipped (because custom
removal commands imply custom semantics). |
-n , --dry-run |
Don’t make any changes, just print what would be done. This makes it easy to evaluate the impact of a rotation scheme without losing any backups. |
-v , --verbose |
Increase logging verbosity (can be repeated). |
-q , --quiet |
Decrease logging verbosity (can be repeated). |
-h , --help |
Show this message and exit. |