0

I am running a batch which generates separate text files(.txt) for separate country codes in corresponding folders. For audit purposes we happen to create log files in the same folder as .txt files. The issue is, on a certain day the log file and the .txt file were not generated and found that the disk space is full.

In such cases how can we audit this issue? Is there any way to capture the exception thrown by the Java program sue to disk space issue?

asthiwanka
  • 437
  • 2
  • 6
  • 17

1 Answers1

0

Obviously you can catch any exception. Just consult any java tutorial for beginners that explains how to catch exception.

However the problem here is not to catch exception when it happens but prevent it. To do this you should monitor the disk space and perform something when it is going to be low before the fatal failure happened.

The following discussion deals with the first question (how to get the available disk space) How to find how much disk space is left using Java?

But what to do if disk space is going to be low?

  1. Write log file
  2. send email/sms/ other notification to person that is responsible on supporting the system.
  3. Thing about zipping or removing the old files.
Community
  • 1
  • 1
AlexR
  • 114,158
  • 16
  • 130
  • 208