You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register
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

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.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!