ckan / ckan-packaging

Ansible scripts to package ckan
12 stars 11 forks source link

/etc/cron.daily/remove_old_sessions should be quiet? #26

Open mathieumd opened 1 month ago

mathieumd commented 1 month ago

On installing python-ckan_2.10-jammy_amd64.deb, the cron remove_old_sessions get installed. Since then, I get this daily mail:

/etc/cron.daily/remove_old_sessions: /usr/bin/find: ‘/tmp/*/session/’: No such file or directory /usr/bin/find: ‘/tmp/sstore/’: No such file or directory run-parts: /etc/cron.daily/remove_old_sessions exited with return code 1

I guess it should be silenced, no?

-    ${SUDO} ${FIND_BIN} $dir ${FIND_OPTIONS} -amin +${REMOVE_OLDER_THAN_MINS} -delete
+    ${SUDO} ${FIND_BIN} $dir ${FIND_OPTIONS} -amin +${REMOVE_OLDER_THAN_MINS} -delete >/dev/null 2>&1
mathieumd commented 2 hours ago

It should also terminate with a success, so here is the diff:

-    ${SUDO} ${FIND_BIN} $dir ${FIND_OPTIONS} -amin +${REMOVE_OLDER_THAN_MINS} -delete
+    ${SUDO} ${FIND_BIN} $dir ${FIND_OPTIONS} -amin +${REMOVE_OLDER_THAN_MINS} -delete >/dev/null 2>&1; true