From fc3234bdf8eca4b3aa9482fab32d52d8b858bc45 Mon Sep 17 00:00:00 2001 From: Tercio Gaudencio Filho Date: Fri, 21 Jan 2022 10:25:40 -0300 Subject: [PATCH] =?UTF-8?q?Released=20version=201.0.0!=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- backup-rclone | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ebe931c..64976e2 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Currently, there is no release or version number, so the easiest installation pr ```bash curl "https://raw.githubusercontent.com/0x3333/backup-rclone/master/backup-rclone" \ - > /usr/bin/backup-rclone && chmod +x /usr/bin/backup-rclone + > /usr/bin/backup-rclone && chmod +x /usr/bin/backup-rclone && /usr/bin/backup-rclone --version ``` The `backup-rclone` executable will be available in the `/usr/bin` folder, and is ready to go. diff --git a/backup-rclone b/backup-rclone index 96589bc..818f814 100755 --- a/backup-rclone +++ b/backup-rclone @@ -18,6 +18,9 @@ from typing import List, Tuple # Constants # +# Version +_VERSION = "1.0.0" + # Default Files _CFG_FILE = "/etc/backup-rclone.conf" _LOG_FILE = "/var/log/backup-rclone.log" @@ -343,7 +346,7 @@ def main(): parser.add_argument("--check", dest="check", action="store_true", help="Check the configuration file.") - parser.add_argument("-p", "--profile", action="append", dest="profiles", default=[], + parser.add_argument("-p", "--profile", action="append", dest="profile", default=[], help="Profile to run. Can be specified multiple times to run multiple profiles. \ If not provided, all profiles will be run") @@ -352,6 +355,8 @@ def main(): parser.add_argument("-o", "--global-post-exec", help="Command to be executed after the profile is run") + parser.add_argument("--version", action="version", version="backup-rclone v%s" % _VERSION) + args = parser.parse_args() # @@ -419,12 +424,12 @@ def main(): _exit_code, _, _ = run_command(args.global_pre_exec) if _exit_code != 0: logging.error( - "global_pre_exec returned %s. Will not run the profiles." % _exit_code) + "global_pre_exec returned %s. Will run no profiles." % _exit_code) sys.exit(_EXIT_FINISHED_WITH_ERRORS) # # Execute Profiles - exit_code = run(args.profiles) + exit_code = run(args.profile) if exit_code == 0: logging.info("backup-rclone finished!") else: