diff --git a/nodes/home/nas.py b/nodes/home/nas.py index 428f269..f212665 100644 --- a/nodes/home/nas.py +++ b/nodes/home/nas.py @@ -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