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

Use multithread compressor #87

Closed
mudragel opened this issue Mar 8, 2017 · 6 comments
Closed

Use multithread compressor #87

mudragel opened this issue Mar 8, 2017 · 6 comments

Comments

@mudragel
Copy link

mudragel commented Mar 8, 2017

How I can use lbzip2 as directory compressor?
Like this:
tar cf linux2.tar.bz2 linux --use-compress-program=lbzip2

@sebastianfeldmann
Copy link
Owner

<backup>
  <source type="tar">
    <option name="path" value="/some/dir"/>
  </source>
  <target dirname="/backup" filename="dir-%Y%m%d-%H%i.tar" compress="bzip2"/>
<backup>

This will create a /backup/dir-20170308-2005.tar.bz2 containing /some/dir

Hope that helps

@mudragel
Copy link
Author

mudragel commented Mar 8, 2017

I mean lbzip2 not standard bzip2. lbzip2 can use multithread for compressing as mentioned at http://www.cnx-software.com/2016/12/16/compress-decompress-files-faster-with-lbzip2-multi-threaded-version-of-bzip2/

@sebastianfeldmann
Copy link
Owner

Currently there is now way to do so :/

@mudragel
Copy link
Author

mudragel commented Mar 8, 2017

It will be a cool feature!

@sebastianfeldmann
Copy link
Owner

Definitely ;)

@sebastianfeldmann
Copy link
Owner

sebastianfeldmann commented Mar 29, 2017

I just backported the new feature to phpbu 4.0.8
You can use it with a configuration like this.

<phpbu>
<backups>
  <backup name="foo">
    <source type="tar">
      <option name="path" value="/dir/to/compress"/>
      <option name="compressProgram" value="lbzip2"/>
    </source>
    <target dirname="backup/src" filename="backup-%Y%m%d-%H%i.tar" compress="bzip2"/>
  </backup>
</backups>
</phpbu>

This should result in a tar command like this

tar --use-compress-program='lbzip2' -cf backup/src/backup20170329-1500.tar.bz2 -C '/dir/to' 'compress'

Hope that helps

Cheers Sebastian

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

No branches or pull requests

2 participants