Skip to Content
avatar image
Former Member

cleaning up log files in $(DIR_INSTANCE)/backup/log


There has ben huge number of logs that are getting generated under $(DIR_INSTANCE)/backup/log directory. Is there a way to dlete this automatically after some days ?

Like script or parmater in HANA studio ?

I know the below

"Each time the log backup job runs, a log segment snapshot or series of files are created in the $(DIR_INSTANCE)/backup/log directory. During the log file backup processes, new files are created each time the job runs. The existing files are not automatically deleted or overwritten. In short, the files will grow indefinitely until they are deleted by the SAP HANA DBA"

Script:

find /usr/sap/../../backup/log/* -mtime +5 -exec rm {} \;

I am looking for somekind of parmater in HANA . Is it possible?

Regards,

Pavan Gunda

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Dec 05, 2014 at 12:18 PM

    In addition, you should understand what you're doing. The Script your are quoting which blindly deletes all log backups will render your backup setup practically unusable (at least for point-in-time recovery, including restoring the DB to the latest consistent state).

    If you really want this behavior, you should disable the automatic log backup, and set the log mode to overwrite. See the Admin guide or Lars' and my book.

    If, on the other hand, you want to set up a useful mechanism that gives you a backup retention time of a few days or week, including management of the data and log backups, the script mentioned in http://scn.sap.com/community/hana-in-memory/blog/2014/11/27/new-and-final-version-of-backup- script is one option to look at. You should in any case make sure you understand the data and log backup mechanisms of HANA, again see the mentioned documentation.

    Best,

    Richard


    Add comment
    10|10000 characters needed characters exceeded

  • Dec 05, 2014 at 11:53 AM

    You could use the script created by @Richard Bremer (New and final version of backup script) to do the clean up for you.

    - Lars

    Add comment
    10|10000 characters needed characters exceeded