Docker-compose not found when using cron to update

I am trying to follow the suggested tip on this to setup a cron job to update Bitwarden but when it runs, I get an error:

_     _ _                         _            
| |__ (_) |___      ____ _ _ __ __| | ___ _ __  
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \ 
| |_) | | |_ \ V  V / (_| | | | (_| |  __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_|  \__,_|\___|_| |_|

Open source password management solutions
Copyright 2015-2019, 8bit Solutions LLC
[https://bitwarden.com](https://bitwarden.com/), https://github.com/bitwarden

===================================================

Docker version 18.09.2, build 6247962
./bitwarden.sh: line 23: docker-compose: command not found

This is my cron job:

@reboot ./bitwarden.sh updateself

If I edit the script and add the full path to docker-compose in front:

/usr/local/bin/docker-compose --version

then it works but after a reboot, the script removes the line.

Any ideas? I am on Ubuntu 16.04.

Thanks!

Could it be that the PATH (of the profile runing the cron) does not include /usr/local/bin/ ?

1 Like

I ended up adding the path to cron:

  PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin

It works perfectly now. Thank you!