Modularize sanitization cronjobs

This commit is contained in:
Salt 2021-12-16 08:11:17 -06:00
parent 6b218b02f9
commit 9b64cf8a00

View File

@ -73,12 +73,15 @@
hour: 3 hour: 3
job: 'find /data/syncthing/data/ -type f -iname "*:Zone.Identifier" -delete' job: 'find /data/syncthing/data/ -type f -iname "*:Zone.Identifier" -delete'
tags: [ cron ] tags: [ cron ]
- name: assure sanitize cronjob - name: assure filename sanitize cronjobs
cron: cron:
name: sanitize name=orig.png name: "sanitize {{ item }}"
minute: 0 minute: 0
hour: 4 hour: 4
job: 'find /data/syncthing/data/ -type f -iname "*?name=orig.png" | while read line; do mv "$line" "${line%?name=orig.png}"; done' job: 'find /data/syncthing/data/ -type f -iname "*{{ item }}" | while read line; do mv "$line" "${line%{{ item }}}"; done'
with_items:
- ?name=orig.png
- ?name=orig.jpeg
tags: [ cron ] tags: [ cron ]
roles: roles:
- role: backup - role: backup