Page MenuHomePhabricator

stat user crontab on stat hosts for old file removal
Open, MediumPublic


On stat1002 we had a cronspam due to a temporary file that was probably removed while the cron was running:

/usr/bin/find: `/a/log/webrequest/archive/api/.api-usage.tsv.log-20151211.gz.YRTnoT': No such file or directory

There are 2 crontab entries that do pretty much the same on different directories:

# Puppet Name: prune_old_eventlogging_logs
0 9 * * * /usr/bin/find /a/eventlogging/archive -type f -mtime +90 -exec rm {} \;
# Puppet Name: prune_old_hdfs_webrequest_archive_logs
0 9 * * * /usr/bin/find /a/log/webrequest/archive -type f -mtime +90 -exec rm {} \;

My suggestion would be to restrict a bit the find matching with something like -name "*.gz" or to exclude hidden files so that a temporary file is not taken into consideration and cannot raise this error.
Also they do it at the same minute, it would be wise to spread them a bit apart one to each other or unify them in a single cron execution 😉

Event Timeline

Volans created this task.Nov 22 2016, 12:10 PM
Volans added a subscriber: Ottomata.