Security unix command not working with cron
I have a program that needs to run every day and is written in Rust. My program works perfectly when I run it in the terminal, but when running it using cron
it gives an error. After a lot of searching I located the problem. My program needs to run the security unix executable (/usr/bin/security
on macOS), specifically the find-generic-password
command. When cron
runs my program it doesn’t find the correct password and it returns the error:
Security unix command not working with crontab
I have a script that needs to run every day and is written in rust. My program works perfectly when I run it in the terminal, but when running it using crontab it gives an error. After a lot of searching I located the problem. My program needs to run the security unix executable (usr/bin/security on macOS), specifically the find-generic-password command. When crontab runs this script it doesn’t find the correct password and it returns the error: