Dashboards & Visualizations

How to revert backup for lookup editor limit?

jadengoho
Builder

Hi,

I'm currently trying to modify the lookup editor app,

But i'm having trouble on limiting previous version, i did it through CSS and HTML.

But the files are still located at the folder. How can i limit the revert version to 5 and delete the older versions.

 

Labels (1)
Tags (1)
0 Karma
1 Solution

jadengoho
Builder

i have solve the issue , with the help of my colleague.

It was on "lookup_backups.py"

jadengoho_0-1601258937379.png

 

View solution in original post

Tags (1)

vince135
Explorer

You can also do something like this in order to delete "old" backups in the folder after some time. It's a quick fix that is working with the 3.6.0 version. You have to place piece of code at the end of the function "backup_lookup_file" (before the return dst) in the "lookup_backups.py" file 🙂

 

           # Remove backup files that are "old"

            list_of_files = os.listdir(backup_directory)
            current_time = time.time()
            for i in list_of_files:
                file_location = backup_directory + "/" + i
                file_time = os.stat(file_location).st_mtime

                if(file_time < current_time - 86400 * 5):
                    os.remove(file_location)
                    self.logger.info('Removing lookup file="%s" from backup folder="%s" because max time excedeed', i, backup_directory)

 

 

 

 

0 Karma

MCH2018
Explorer

Hello,

Is this still working with 4.0.2 version of the app ?
I made the change, but unfortunately, nothing happens. How do you trigger the deletion? Restart Splunk? Unfortunately, I can no longer make any backups because I get an error saying that I have reached the size limit for backups.

Thanks for your help.

Tags (4)
0 Karma

jadengoho
Builder

i have solve the issue , with the help of my colleague.

It was on "lookup_backups.py"

jadengoho_0-1601258937379.png

 

Tags (1)

DaClyde
Contributor

With the changes in v3.6.0 of the app in the past month, is this still valid?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...