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:
"security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.n"
(It does find the correct value when I run my script using terminal)
I presume this has something to do with how crontab runs the script and which user is active but is there a way to fix this error? And if not is there a crontab alternative in rust I can use?
Thanks in advance