From 8523e61a17b850094f812ab56fc1e211fe90d287 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 12 Dec 2016 13:34:00 +0100 Subject: [PATCH] add comments --- general/backup/borg_interface/borg_interface.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/general/backup/borg_interface/borg_interface.py b/general/backup/borg_interface/borg_interface.py index 0b0c56c..c321d03 100755 --- a/general/backup/borg_interface/borg_interface.py +++ b/general/backup/borg_interface/borg_interface.py @@ -2,10 +2,15 @@ import os import borg_variables import sys +import configparser + chosen_activity = 100 + # Setting the environment variables os.environ['BORG_REPO'] = str(borg_variables.repository) os.environ['BORG_PASSPHRASE'] = str(borg_variables.password) + +# The main menu starts there while chosen_activity != 0: print("What would you like to do?") # Start the chosen activity and go back to the activity selector. @@ -13,11 +18,16 @@ while chosen_activity != 0: try: chosen_activity = int(input("Choose the desired activity:")) if chosen_activity == 1: + # prints all the archives in the repository and lists them with + # less os.system('borg list | less') if chosen_activity == 2: + # Displays all the information related to the archive name the user + # enters archive_name = input("Please enter the archive name: ") os.system('borg info ::' + archive_name) if chosen_activity == 3: + # mounts a chosen archive to /tmp/archive name archive_name = input("Please enter the archive name: ") mount_point = "/tmp/" + archive_name if not os.path.exists(mount_point):