Issue bench commands through crontab

I’m trying to issue bench commands (like bench update or bench restart) through crontab in ubuntu. I’m getting an error as " bench: not found". The locatyion of bench program is not available. I guess it used to be at frappe-bench/env/bin/bench and now it might have been relocated. Anyone can help me with the location of bench executable? This is my command that fails -
0 10 * * * cd /home/ubuntu/frappe-bench && /home/ubuntu/frappe-bench/env/bin/bench update --auto >> /home/ubuntu/frappe-bench/logs/auto_update_log.log 2>&1

The location /home/ubuntu/frappe-bench/env/bin/bench is not correct and I dont know what the correct location is.


0 10 * * * cd /home/ubuntu/frappe-bench && bench update --auto >> /home/ubuntu/frappe-bench/logs/auto_update_log.log 2>&1

I still get the same error -
/bin/sh: 1: bench: not found

If you use the standard install I don’t believe if you require the Ubuntu part of the path.

Eg I use /home/frappe/frappe-bench

If you installed with the frappe user /home/frappe is it’s home directory for that user.

replace /home/ubuntu/frappe-bench/env/bin/bench by output of

 which bench 
1 Like

Thanks. This worked.