Note!! Please register for a free account to access the full content and also to participate in Q&A in the community
OCI: Cron Job for Oracle User Is Not Running
in Linux
Applies to:
Oracle Cloud Infrastructure - Version N/A and later
Oracle Linux - Any version
Symptoms:
A cron job is not executing the script even though there is activity logged in the cron logs:
cron-1685379661:2023-05-29T09:10:06.861023+07:00 hostname crontab[77605]: (oracle) LIST (oracle) cron-1685466061:2023-05-30T14:00:01.369598+07:00 hostname CROND[55813]: (oracle) CMD cron-1685466061:2023-05-30T14:00:01.369598+07:00 hostname CROND[55813]: (oracle) CMD (/u02/.../script.sh) cron-1685466061:2023-05-30T14:00:01.369598+07:00 hostname CROND[55813]: (oracle) CMD (/u02/.../script.sh)
Cause:
cron jobs do not have access to the user's environment variables. This is a security feature.
If a script makes use of environment variables like PATH or ORACLE_HOME those will not be defined when the script is executed via crontab entries.
Tagged:
1