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
job: 'find /data/syncthing/data/ -type f -iname "*:Zone.Identifier" -delete'
tags: [ cron ]
- name: assure sanitize cronjob
- name: assure filename sanitize cronjobs
cron:
name: sanitize name=orig.png
name: "sanitize {{ item }}"
minute: 0
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 ]
roles:
- role: backup