diff --git a/CHANGELOG.md b/CHANGELOG.md index bcd5407da5bd0856a7f62a0e46aa9f11c7cf870d..aeb872052b1f5a4bd721b1ddbf476b1cfc710c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.0.0] - 2020-07-16 +## [1.0.0] - 2020-07-23 ### Added - add setup.py @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - grafanaSettings can now be parameterized via an external json config file (~/.grafana-backup.json) - refactored backup/restore shell scripts - individual components can be backed up using console_script +- archiving of backup can now be skipped using --no-archive ### Removed - delete Pipenv diff --git a/grafana_backup/cli.py b/grafana_backup/cli.py index 66cc5c6076a4f11d9d7528bf9faf79a4c2c646fd..21089c24bcb8125a3fc68ddf27a8b8860a6e874d 100644 --- a/grafana_backup/cli.py +++ b/grafana_backup/cli.py @@ -9,7 +9,7 @@ docstring = """ {0} {1} Usage: - grafana-backup save [--config=<filename>] [--components=<folders,dashboards,datasources,alert-channels>] + grafana-backup save [--config=<filename>] [--components=<folders,dashboards,datasources,alert-channels>] [--no-archive] grafana-backup restore <archive_file> [--config=<filename>] grafana-backup [--config=<filename>] grafana-backup -h | --help @@ -21,6 +21,7 @@ Options: --config=<filename> Override default configuration path --components=<folders,dashboards,datasources,alert-channels> Comma separated list of individual components to backup rather than backing up all components by default + --no-archive Skip archive creation and do not delete unarchived files """.format(PKG_NAME, PKG_VERSION) args = docopt(docstring, version='{0} {1}'.format(PKG_NAME, PKG_VERSION)) diff --git a/grafana_backup/save.py b/grafana_backup/save.py index 6cd32e719dc549c07b331ccdec4d58e7848096a4..5df2e1d7267e97e10be3b5bc51334ba0353d8569 100644 --- a/grafana_backup/save.py +++ b/grafana_backup/save.py @@ -7,6 +7,7 @@ from grafana_backup.archive import main as archive def main(args, settings): arg_components = args.get('--components', False) + arg_no_archive = args.get('--no-archive', False) backup_functions = { 'dashboards': save_dashboards, 'datasources': save_datasources, @@ -23,4 +24,5 @@ def main(args, settings): for backup_function in backup_functions.keys(): backup_functions[backup_function](args, settings) - archive(args, settings) + if not arg_no_archive: + archive(args, settings)