Skip to content

Instantly share code, notes, and snippets.

View maqnius's full-sized avatar

Mark maqnius

  • Bochum
View GitHub Profile
@maqnius
maqnius / daily.py
Created February 25, 2026 14:24
execute restic profile if possible and not done yet
#!/usr/bin/env python3
"""
Execute resticprofiles if possible and at most once daily.
Can and should be polled until successful e.g.:
# try every 10 minutes to backup if not done yet
*/10 * * * * daily.py nextcloud >> /var/log/backup_nextcloud.log 2>&1
Last backup ist tracked with a lock file next to daily.py for each repository.
@maqnius
maqnius / forms.py
Created November 18, 2021 16:44
django crispy forms: Nesting a formset within a form
# Include formset as crispy forms layout object
self.helper.layout = Layout(
Div(
Field('my_field'),
Formset('my_formset', 'my_formset_helper'),
Button('Add New', 'add-extra-formset-fields'),
),
)