bundles/backup-{client,server}: introduce
This commit is contained in:
parent
59c1cb8551
commit
f71653e3ce
23 changed files with 171 additions and 0 deletions
21
bundles/backup-client/metadata.py
Normal file
21
bundles/backup-client/metadata.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from hashlib import md5
|
||||
|
||||
defaults = {
|
||||
'backup-client': {
|
||||
# unix user names cannot be longer than 32 characters.
|
||||
# bundlewrap raises an error if the name is longer than 30 chars.
|
||||
'user-name': 'c-' + md5(node.name.encode('UTF-8')).hexdigest()[:28],
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor
|
||||
def cron(metadata):
|
||||
if metadata.get('backups/exclude_from_backups', False):
|
||||
return {}
|
||||
|
||||
return {
|
||||
'cron': {
|
||||
'backup': '{} 1 * * * root /usr/local/bin/generate-backup',
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue