mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-03-14 10:44:13 +00:00
Changed the way command passed to the Flask endpoint
This commit is contained in:
parent
376e38942b
commit
956336da4b
1 changed files with 6 additions and 4 deletions
10
main.py
10
main.py
|
@ -493,10 +493,12 @@ def ListAllBackups():
|
|||
@app.route("/services/restic/backup/create", methods=["PUT"])
|
||||
|
||||
def CreateSingleBackup():
|
||||
backupProcessDescriptor = subprocess.Popen(["restic", "-r", "b2:" +
|
||||
request.headers.get("X-Repository-Name") + ":/sfbackup", "--verbose", "backup", "/var",
|
||||
"--password-file", "/var/lib/restic/rpass"
|
||||
])
|
||||
|
||||
backupCommand = '''
|
||||
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]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue