create basic functions

This commit is contained in:
Andreas Zweili 2016-11-13 22:14:09 +01:00
parent cc5b1f58d9
commit 4928a7dd35
3 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,12 @@
.idea
__pycache__
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags

View File

@ -0,0 +1,23 @@
#!/usr/bin/env python3
import os
import borg_variables
import sys
# Setting the environment variables
os.environ['BORG_REPO'] = str(borg_variables.repository)
os.environ['BORG_PASSPHRASE'] = str(borg_variables.password)
print("What would you like to do?")
# Start the chosen activity and go back to the activity selector.
print("1: List Backups, 2: Show archive details, 0: Exit")
try:
chosen_activity = int(input("Choose the desired activity:"))
if chosen_activity == 1:
os.system('borg list')
if chosen_activity == 2:
archive_name = input("Please enter the archive name ")
os.system('borg info ::' + archive_name)
elif chosen_activity == 0:
sys.exit()
except ValueError:
print("test")

View File

@ -0,0 +1,3 @@
#!/usr/bin/env python3
repository = "borg@fileserver.2li.local:/home/borg/backup/gwyn"
password = "iEw74xjem7gvsJrShCVCbYrAwX7yUo"