I would appreciate if you responded to my earlier request , it might actually throw some light to the reason behind the log not needing rotating.
tks
I would appreciate if you responded to my earlier request , it might actually throw some light to the reason behind the log not needing rotating.
tks
I’ve already replied.
The command works fine.
Just for you:
output of manually run find command on audit directory.
no-highlight
oracle@LDN_ORA_DEV:/home/oracle/logrotateconf $ /usr/bin/find /apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/ -name "*.aud*
" -type f -mtime +30 |more/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_100927_20230606054219440451143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_101005_20230331154051435103143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_101012_20230606054220525736143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_101041_20230604173925743180143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_102904_20230603173746458276143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_102971_20230603173747645101143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_105349_20230323022616514571143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_105409_20230323022617591983143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_106205_20230604053840066794143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_106288_20230604053841303229143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_106392_20230603053658681899143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_106503_20230603053659843267143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_107579_20230605174115959240143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_107644_20230415160716852504143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_107677_20230605174117061284143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_107931_20230427164525256455143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_107943_20230427164526282552143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_107968_20230304015211264141143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_108049_20230304015212339494143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_10809_20230310140357780734143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_10933_20230324142850179247143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_10942_20230310140358860233143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_110272_20230206130122324453143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_110348_20230206130123399590143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_110442_20230207130327127687143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_110465_20230510173811881590143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_110479_20230510173812963384143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_127203_20230312020627439632143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_127765_20230225134001996503143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_127874_20230210010807058048143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_127905_20230225134003079272143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_128184_20230326033120654916143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_128238_20230326033121733679143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_129610_20230509164942470611143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_129724_20230509164943674827143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_130209_20230317141636027442143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_130226_20230427170630051553143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_144811_20230513045628937184143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/delphix_sid_ora_146664_20230609054750555834143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/F2BD2_ora_101039_20230506023824218291143795.aud
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/F2BD2_ora_101057_20230430223354024554143795.aud
--More--
Please could anyone suggest why the postrotate script is not running.
@jonnyd , I can't see any, you have shown a find...
listing not ls -al
, is there something in that request that you/I have missed ?
thks
Oracle itself may also have some logrotate settings, you'd need to consult Oracle documentation, I don't have an Oracle account to access.
Ive proved the find command works on the command line.
This is not an #'Oracle' issue. Im trying to clear down text files using logrotate.
Logrotate is a unix/linux utility.
This is whats in the postrotate configfile.
Please could you suggest why the postrotate script is not running?
Sorry, as you are obviously unwilling to help us help you I am no longer able to assist.
good luck
I’m afraid you have not been helpful at all.
I think the problem is pretty clear.
Postrotate script is not running, why not?
@jonnyd,
there're plenty of Google hits for log does not need rotating (log size is below the 'size' threshold)
Folks have been suggesting adding --debug
to the logrotate
cli: logrotate -vdf /my/directory/for/logrotate.conf
to see what logrotate
was atetmpting to do.
See if Googling helps.
BTW, what's your OS?
Thanks I’ll try that.
I only came to this forum because there wasn’t much on Google tbh.
I don't know why the find command does not work in the postrotate; perhaps you have extra backtick characters that should not be there? Ah, you perhaps did it to escape the *
that means a kind of highlighting in this Web application. You should wrap the whole code in triple-backticks like this
```
code
code with * and `backticks`
more code
```
Deleting the rotated log files after a certain time is pretty standard - can be done with maxage
:
/apps/oracle/database/RFXD2/product/12.1.0.2/rdbms/audit/*.aud {
missingok
nomail
maxage 30
}
@jonnyd,
Whatever progress you and/or find a solution, please do come back and share your findings with the rest of the community.
Thanks
PS wondering if you need logrotate at all. Sounds like you don't want to "rotate" anything, but simply remove old files. If that's the case, would a simple find ... -exec rm {}\;
do it?
yes youre probably right.
Logrotate seems to work for archiving an individual file, ie an alert log.
I'll keep trying until I get a solution and update the thread.
Thanks for all suggestions.
jd
The message you are getting about no files needing to be rotated is the clue here.
No files need to be rotated (according to the default values), therefore the postrotate section isn't running -- because nothing rotated.
If you only want to delete files older than 30 days, why not use the maxage
value in logrotate?
= = ] snip from man page [ = =
maxage count
Remove rotated logs older than days. The age is only checked if the logfile is to be rotated. The files are mailed to the configured address if maillast and mail are configured.
= = ] end snip [ = =
To be honest, I've had similar issues with logrotate doing odd things like this. The reason is that logrotate is a rather simple system -- it's not as smart as you think it is.
In your case, I would just put your find command in the crontab and run it once daily.
$0.02
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.