home.nas: move cron jobs to systemd timers

This commit is contained in:
Franzi 2022-02-06 13:40:54 +01:00
parent 0674b3f8db
commit 46e6b0f704
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -62,19 +62,6 @@ nodes['home.nas'] = {
# 'my_ssh_port': 2022,
# 'zfs-base': 'storage/backups',
#},
'cron': {
'jobs': {
# Ensure every user is able to read and write to the NAS dataset.
'nas_permissions': '0 3 * * * root '
'chown -R :nas /storage/nas/ && '
'find /storage/nas/ -type d -exec chmod 0775 {} \; && '
'find /storage/nas/ -type f -exec chmod 0664 {} \;',
'nas_mixcloud': vault.decrypt('encrypt$gAAAAABgxFkM0Zd8SOhk8aK_zsUY5S39FvyxvEq9TVnAK-ryn9qjrpziqUgNyPXFQBSUHPCV5DX6CW6iSQFGO54truPoaymdHFwchWh3u6bOar_h8x3er3I=').format_into(
'0 2 * * * kunsi '
'cd /storage/nas/Musik/Compilations && '
'wget --mirror --page-requisites --convert-links --domains {0} --execute robots=off https://{0}/'),
},
},
'groups': {
'nas': {},
},
@ -190,6 +177,23 @@ nodes['home.nas'] = {
},
},
},
'systemd-timers': {
'timers': {
# Ensure every user is able to read and write to the NAS dataset.
'nas_permissions': {
'command': 'chown -R :nas /storage/nas/ && '
'find /storage/nas/ -type d -exec chmod 0775 {} \; && '
'find /storage/nas/ -type f -exec chmod 0664 {} \;',
'when': '*-*-* 03:00:00',
},
'nas_mixcloud': {
'command': vault.decrypt('encrypt$gAAAAABgxFkM0Zd8SOhk8aK_zsUY5S39FvyxvEq9TVnAK-ryn9qjrpziqUgNyPXFQBSUHPCV5DX6CW6iSQFGO54truPoaymdHFwchWh3u6bOar_h8x3er3I=').format_into('wget --mirror --page-requisites --convert-links --domains {0} --execute robots=off https://{0}/'),
'pwd': '/storage/nas/Musik/Compilations',
'user': 'kunsi',
'when': '*-*-* 02:00:00',
},
},
},
'openssh': {
'allowed_users': {
'kunsi-t470', # backup user