Add --resticbin argument
This commit is contained in:
parent
b09651f130
commit
3d2f93e5b7
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
source ~/.restic-env
|
source ~/.restic-env
|
||||||
~/restic_many.py backup
|
~/restic_many.py backup --resticbin /home/restic/bin/restic
|
|
@ -11,7 +11,7 @@ import socket
|
||||||
import traceback
|
import traceback
|
||||||
import time
|
import time
|
||||||
|
|
||||||
restic_bin = '/home/restic/bin/restic'
|
restic_bin = 'restic'
|
||||||
|
|
||||||
init_command = "restic -r %s init"
|
init_command = "restic -r %s init"
|
||||||
command = "restic -r %s backup --verbose %s"
|
command = "restic -r %s backup --verbose %s"
|
||||||
|
@ -110,8 +110,9 @@ def cmd_list():
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description = "backup or mount many paths using restic")
|
parser = argparse.ArgumentParser(description = "backup or mount many paths using restic")
|
||||||
parser.add_argument('command', help='command to run (backup, mount, umount)')
|
parser.add_argument('command', help='command to run (backup, mount, umount)')
|
||||||
|
parser.add_argument('--resticbin', help='restic binary location, if not on PATH')
|
||||||
|
|
||||||
args = parser.parse_args(sys.argv[1:2]) # this kinda sucks. there has to be a betterw ay
|
args = parser.parse_args()
|
||||||
|
|
||||||
# call function with the name.
|
# call function with the name.
|
||||||
fn_name = "cmd_" + args.command
|
fn_name = "cmd_" + args.command
|
||||||
|
@ -119,4 +120,8 @@ if not fn_name in globals():
|
||||||
print("Command doesn't exist")
|
print("Command doesn't exist")
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
if args.resticbin:
|
||||||
|
restic_bin = args.resticbin
|
||||||
|
|
||||||
globals()[fn_name]()
|
globals()[fn_name]()
|
||||||
|
|
Loading…
Reference in New Issue