mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-10-01 04:22:54 +00:00
Changed the way command passed to the Flask endpoint
This commit is contained in:
parent
376e38942b
commit
956336da4b
10
main.py
10
main.py
|
@ -493,10 +493,12 @@ def ListAllBackups():
|
||||||
@app.route("/services/restic/backup/create", methods=["PUT"])
|
@app.route("/services/restic/backup/create", methods=["PUT"])
|
||||||
|
|
||||||
def CreateSingleBackup():
|
def CreateSingleBackup():
|
||||||
backupProcessDescriptor = subprocess.Popen(["restic", "-r", "b2:" +
|
|
||||||
request.headers.get("X-Repository-Name") + ":/sfbackup", "--verbose", "backup", "/var",
|
backupCommand = '''
|
||||||
"--password-file", "/var/lib/restic/rpass"
|
restic -r b2:{}:/sfbackup --verbose backup /var --password-file /var/lib/restic/rpass
|
||||||
])
|
'''.format(request.headers.get("X-Repository-Name"))
|
||||||
|
|
||||||
|
backupProcessDescriptor = subprocess.Popen(backupCommand, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
backupProcessDescriptor.communicate()[0]
|
backupProcessDescriptor.communicate()[0]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue