A
A
achirkov02021-01-15 08:14:08
ubuntu
achirkov0, 2021-01-15 08:14:08

Cron not running command, what's wrong?

ubuntu 18.04
There is a cron job in /etc/crontab and it won't run:

20 * * * *      root    /usr/bin/find /home/user/temps/ -type f -mmin +20 -delete

If you run /usr/bin/find /home/user/temps/ -type f -mmin +20 -delete in the terminal - everything is fine.
grep CRON /var/log/syslog does not find that the command was executed.
journalctl -u cron.service is empty, a couple of entries from last year.
What is wrong with cron and how can I diagnose the problem more?
PS cleaned journalctl, data appeared, here's what happens in cron (but files are not deleted)
CRON[17590]: pam_unix(cron:session): session opened for user root by (uid=0)
CRON[17591]: (root) CMD (/usr/bin/find /home/user/temps/ -type f -mmin +15 -delete )
CRON[17590]: pam_unix(cron:session): session closed for user root

Added > /tmp/output- the file is empty

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Karasik, 2021-01-15
@achirkov0

Weird!
Are you sure that there are "old" files left?
Change temporarily to something like
* * * * * root /usr/bin/find /home/user/temps >> /tmp/cron-debug.out 2>&1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question