Update 'main.py'
parent
c1c9f18521
commit
37bb014994
6
main.py
6
main.py
|
@ -495,15 +495,15 @@ def ListAllBackups():
|
||||||
def CreateSingleBackup():
|
def CreateSingleBackup():
|
||||||
|
|
||||||
backupCommand = '''
|
backupCommand = '''
|
||||||
restic -r b2:{}:/sfbackup --verbose backup /var --password-file /var/lib/restic/rpass
|
restic -r b2:{0}:/sfbackup --verbose backup /var --password-file /var/lib/restic/rpass
|
||||||
'''.format(request.headers.get("X-Repository-Name"))
|
'''.format(request.headers.get("X-Repository-Name"))
|
||||||
|
|
||||||
backupProcessDescriptor = subprocess.Popen(backupCommand, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
backupProcessDescriptor = subprocess.Popen(backupCommand, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
backupProcessDescriptor.communicate()[0]
|
commandOutput=backupProcessDescriptor.communicate()[0]
|
||||||
|
|
||||||
return jsonify(
|
return jsonify(
|
||||||
status=backupProcessDescriptor.returncode
|
commandOutput
|
||||||
)
|
)
|
||||||
|
|
||||||
@app.route("/services/ssh/key/send", methods=["PUT"])
|
@app.route("/services/ssh/key/send", methods=["PUT"])
|
||||||
|
|
Loading…
Reference in New Issue