I have a list of commands to run every day. When I copy paste it directly to terminal and run it is working but when I copy paste the same command to cron its not working.
This is the command
0 10 * * * commcare-export --query /home/administrator/Documents/commCareExcelFiles/case_data/1.xlsx --project projectX --output-format sql --output postgresql://user:pass12345@localhost:5432/dbname --username username@gmail.com --auth-mode apikey --password 0ecc3417ad8424ce5eac698092
I can see in cron logs the following
(administrator) CMD ( commcare-export --query/home/administrator/Documents/commCareExcelFiles/case_data/1.xlsx --project projectX --output-format sql --output postgresql://user:pass12345@localhost:5432/dbname --username username@gmail.com --auth-mode apikey --password 0ecc3417ad8424ce5eac698092)
But when I check the database there are no new records, unless it's ran directly from terminal. L
commcare-export
, as the cron job will not know where to look for that tool. – matigo Nov 15 '21 at 08:01