Linux Operating System (MOSC)

MOSC Banner

Crontab Job

edited Dec 13, 2019 2:47PM in Linux Operating System (MOSC) 5 commentsAnswered ✓

OS: RHEL 6.10

DB: oracle 11.2 G RAC

Question: I need to following command in a crontab job:

find * -mtime +8 -exec rm -rf {} \;

I would like to run it in this directory: /opt/ora/11.2.0/log/diag/tnslsnr/1234/listener_scan/alert

Can I write it like this in crontab -e:  0 05 15 * *  /opt/ora/11.2.0/log/diag/tnslsnr/1234/listener_scan/alert  find * -mtime +8 -exec rm -rf {} \;

It will run every 15th of a Month at 5 AM, it will remove any files older than 8 days in that directory.

Thanks for your help.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center