mirror of
https://gitlab.sectorq.eu/jaydee/omv_backup.git
synced 2025-07-01 23:58:33 +02:00
added v3
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import subprocess
|
||||
import requests
|
||||
print("Backup gitlab")
|
||||
cmnd = 'docker exec -t gitlab gitlab-backup create SKIP=artifacts,repositories,registry,uploads,builds,pages,lfs,packages,terraform_state'
|
||||
status, output = subprocess.getstatusoutput(cmnd)
|
||||
@ -9,3 +10,23 @@ cmnd = "docker exec nextcloud-db-1 sh -c 'exec mysqldump --single-transaction -h
|
||||
status, output = subprocess.getstatusoutput(cmnd)
|
||||
cmnd = "docker exec --user www-data nextcloud-app-1 php occ maintenance:mode --off"
|
||||
status, output = subprocess.getstatusoutput(cmnd)
|
||||
|
||||
|
||||
headers = {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
'x-api-key':'ptr_gfwpbP4AUDhZ4uoPmSfNUGqZq+gescoele8reP/l/GU=',
|
||||
}
|
||||
|
||||
json_data = {
|
||||
'password': 'l4c1j4yd33Du5lo',
|
||||
}
|
||||
|
||||
response = requests.post('https://portainer.sectorq.eu/api/backup', headers=headers, json=json_data, verify=False)
|
||||
|
||||
# Note: json_data will not be serialized by requests
|
||||
# exactly as it was in the original request.
|
||||
#data = '{ "password": "" }'
|
||||
#response = requests.post('https://portainer.sectorq.eu/api/backup', headers=headers, data=data, verify=False)
|
||||
|
||||
with open('/share/docker_data/__backups/portainer_snapshot.tar.gz', 'wb') as f:
|
||||
f.write(response.content)
|
Reference in New Issue
Block a user