cancel
Showing results for 
Search instead for 
Did you mean: 

Prevent Cronjob Log-Files from being saved or delete them after job completed based on condition.

arwez
Explorer

Hi

I have a cronjob that checks on the presence of some files on the filesystem. Depending on whether or not those files are present I would like to decide whether or not a logfile should be generated for the current cronjob executions.

The initial idea was to simply override JobPerformable.isPerformable() in my Job implementation, however it looks like this does not prevent the log files from being generated and attached to the cronjob.

Another idea was to use the existing CronJob.logToFile property. Unluckily, this property is evaluated before the cronjob executes though.

I guess it would also be acceptable to simply delete the generated file + removing it from CronJob.logFiles after it has executed based on the final CronJobStatus. I am not sure where I could do that though. It seems like Interceptors do not get called when CronJob.logFiles is modified. Is there any way to achieve what I want without overriding Jalo logic? I want to avoid that at all cost.

Thanks a lot in advance.

hima_gh
Explorer
0 Kudos

Hi Armin,

If you have got solution for this question, Can you please post it here?

Regards,

HB

arwez
Explorer

Hi
I gave up on this issue after trying for quite some time. Sry 😞

Accepted Solutions (0)

Answers (0)