Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantity cleanup for gzip/bzip2 #156

Closed
lushndm opened this issue Sep 13, 2018 · 8 comments
Closed

Quantity cleanup for gzip/bzip2 #156

lushndm opened this issue Sep 13, 2018 · 8 comments
Assignees
Labels

Comments

@lushndm
Copy link

lushndm commented Sep 13, 2018

When I setup cleanup by quantity it's not work for target with compress. Backups are not deleted.
After turning off compress
cleanup by quantity working good.
What can I do?

@sebastianfeldmann
Copy link
Owner

sebastianfeldmann commented Sep 13, 2018

Could you Share your config without any passwords or other secret data.
I'm curious about the compression and encryption you are using and the cleanup configuration in particular

I'll try to reproduce this tomorrow morning

@lushndm
Copy link
Author

lushndm commented Sep 19, 2018

<phpbu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="http://schema.phpbu.de/5.0/phpbu.xsd">
  <backups>
    <backup name="xtra">
      <!-- create a json logfile -->
      <log type="json" target="/home/appuser/mybackups/log-xtrabackup.json"/>

      <adapter type="env" name="myEnv"></adapter>

      <!-- source xtrabackup -->
      <source type="xtrabackup">
        <option name="user" value="***" />
        <option name="password" value="***" />
      </source>

      <target dirname="/backups/mysql-xtra"
              filename="xtra-%Y%m%d-%H%i"
              compress="gzip"/>

      <!-- cleanup quantity: keep the last 3 backups -->
      <cleanup type="quantity">
        <option name="amount" value="3"/>
      </cleanup>

    </backup>
  </backups>
</phpbu>

@lushndm
Copy link
Author

lushndm commented Sep 19, 2018

compress="gzip"

Same case for compress="bzip2"

@sebastianfeldmann
Copy link
Owner

sebastianfeldmann commented Sep 19, 2018

what kind of source are you using?
forget it just saw your config posting 🙈

@lushndm
Copy link
Author

lushndm commented Sep 24, 2018

Any news?

sebastianfeldmann added a commit that referenced this issue Sep 24, 2018
In cases where sources create a directory and phpbu has to compress the
directory with tar first phpbu will add a '.tar' suffix to the target.

The regex to collect all backups for cleanup was created before all
suffixes where set correctly. This resulted in not working cleanups.

The issue is fixed by creating the regex right before all backups
are collected.
@sebastianfeldmann
Copy link
Owner

Sorry, last days where a bit busy ;)

I found the issue and I will release a bugfix version asap.

@sebastianfeldmann
Copy link
Owner

I just released version 5.1.3 including a fix for this issue

@sebastianfeldmann
Copy link
Owner

Thanks for reporting this issue and for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants