The cron job does not run

Operating system: CentOS 7 (64bits) + Webmin and virtualmin
OS version: 7 (64bits)


I have this cron job and when I click Run now it works fine, but when it is time to execute the cron, it doesn’t run

What can happen?

What logs saying??


this is the *.sh

#!/bin/bash -ex
exec > >(tee /var/log/fichaje.log|logger -t fichaje -s 2>/dev/console) 2>&1
echo BEGIN
date '+%Y-%m-%d %H:%M:%S'
cd /var/www/Fichaje
behave -n 'Fichaje entrada'
echo END

When I run manually the scrip works well, but when is executed by the cron the log say me:

2021-03-10 08:14:02
/var/www/Fichaje/ line 6: behave: command not found

I do not understand why it does not recognize behave when if I do it manually it recognizes it

thank you very much

I would guess that ‘behave’ isn’t in your $PATH.
In scripts ran by cron you should always include the full path to the commands.

thank you very much, i put the full path and work correctly, anaway, how i can put in the path behave?

thank you very much

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.