Commit 0b38d8fd authored by Björn's avatar Björn

adding #11 #12

parent 78523318
......@@ -65,7 +65,7 @@ Restore Backup
Restore Backup
```bash
./backup.py restore --d <directory>
./backup.py restore --f --d <directory>
```
**[default]**
......
......@@ -114,6 +114,8 @@ class Backup(Config):
#
def _gpg_key_id(self):
gpg_key_id = None
if (getpass.getuser() == 'root'):
gpgpath = '/root/.gnupg'
else:
......@@ -128,6 +130,12 @@ class Backup(Config):
gpg_key_id = key['keyid']
break
if gpg_key_id == None:
self._log('Error: gpg_key_recipient not found!', 'yellow')
self._log('Backup Failed! Exit Script!', 'red')
self._sendmail()
exit()
return '--encrypt-key=' + gpg_key_id
#
......@@ -246,7 +254,14 @@ class Backup(Config):
#
#
def _files(self):
process = self._command('duplicity list-current-files ' + self._target())
options = ''
# adding time
if self._args.time:
options += ' --time ' + self._args.time
process = self._command('duplicity list-current-files ' + options + ' ' + self._target())
self._log(process.stdout)
if (process.stderr):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment