Browse Source

move local folder config in config.json

master
Christian Urich 5 years ago
parent
commit
8f14b4f223
2 changed files with 13 additions and 7 deletions
  1. +3
    -2
      backup.py
  2. +10
    -5
      config.json.example

+ 3
- 2
backup.py View File

@ -2,11 +2,12 @@ import json
import os
def main():
backup_path = '/Users/Jowe1999/Desktop/test'
with open('config.json', 'r') as config_file:
config = json.load(config_file)
for host in config:
backup_path = config['local']['path']
for host in config['remote']:
print('conect to ' + host)
for service in config[host]:
backup_dir = '{}/{}'.format(backup_path, service).lower()


+ 10
- 5
config.json.example View File

@ -1,9 +1,14 @@
{
"host" : {
"service" : "path/to/backups/*"
"remote" : {
"host" : {
"service" : "path/to/backups/*"
},
"host2" : {
"service1" : "path/to/backups/*",
"service2" : "path/to/backups/*"
}
},
"host2" : {
"service1" : "path/to/backups/*",
"service2" : "path/to/backups/*"
"local" : {
"path" : "/backup/storage/folder/"
}
}

Loading…
Cancel
Save