Bench - Error: No such command "execute"

I have this cron schedule.

0 8 * * * cd /home/deploy/frappe-bench && /usr/local/bin/bench execute residences.task.generate_jv_billing > /home/deploy/frappe-bench/logs/generate_jv_billing.log 2>&1

but error occurred in the log file

sage: bench [OPTIONS] COMMAND [ARGS]...

Error: No such command "execute".

Why bench cannot recognized the execute command?

I have solve this problem with this entry in cron

0 8 * * * /bin/bash -l -c 'cd /home/deploy/frappe-bench && /usr/local/bin/bench execute residences.task.generate_jv_billing > /home/deploy/frappe-bench/logs/generate_jv_billing.log'
3 Likes