I wrote a Python script which backs up mongoDB, and it works fine when I test run directly in terminal.
However, I get an error from cron saying mongodump: command not found
- although the command mongodump
works fine when I run the script directly in terminal.
Contents of crontab -e
:
* * * * * cd <path-to-script> && python3 script.py