Page 1 of 1
Tar or Zip support for download album
Posted: Thu Jan 15, 2015 10:22 pm
by ix6tech
I am wondering if there is a functional tar, or zip facsimile in linux (RHEL/CentOS) to using "7za a -tzip -mx0 -- %destination @%list" to utilize the download album function.
Yes, I am aware that simply installing p7zip would simplify this process, however, p7zip will not be an option for the server I am implementing this for.
Thank you,
Chris
Re: Tar or Zip support for download album
Posted: Sat Jan 17, 2015 11:17 am
by wbartels
I have found a working zip solution on Ubuntu.
This should also work on RHEL/CentOS.
Code: Select all
$cfg['download_album_cmd'] = 'cat %list' . ' | ' . $cfg['bin_dir'] . 'zip --junk-paths -0 %destination -@';
Please do some intensive testing and let me know if it also works for you?
If there are no problems I will add both config setting to the upcoming netjukebox with something like:
Code: Select all
// +------------------------------------------------------------------------+
// | Download album (with 7-Zip or zip) |
// +------------------------------------------------------------------------+
// | http://www.7-zip.org |
// | |
// | 7za uses the LANG envirement variabale, normaly this is only set when |
// | PHP is running in CLI mode. |
// +------------------------------------------------------------------------+
// | http://www.info-zip.org/ |
// | |
// | For zip the LANG envirement variabale is not needed. |
// | And can be set to an empty string: |
// | $cfg['download_album_env_lang'] = ''; |
// +------------------------------------------------------------------------+
$cfg['download_album_mime_type'] = 'application/zip';
$cfg['download_album_env_lang'] = 'en_US.UTF-8';
$cfg['download_album_extension'] = 'zip';
$cfg['download_album_cmd'] = $cfg['bin_dir'] . '7za a -tzip -mx0 -- %destination @%list';
// $cfg['download_album_cmd'] = 'cat %list' . ' | ' . $cfg['bin_dir'] . 'zip --junk-paths -0 %destination -@';
Re: Tar or Zip support for download album
Posted: Sun Jan 18, 2015 3:33 am
by ix6tech
This works perfectly! I also tested it using a .tar format, and the results are extremely fast for archiving.
Thank you,
Chris
Re: Tar or Zip support for download album
Posted: Sun Jan 18, 2015 9:15 am
by wbartels
ix6tech wrote:This works perfectly! I also tested it using a .tar format, and the results are extremely fast for archiving.
Thank you,
Chris
Thanks for the feedback!
With the settings below it creates a tar file.
However it also add the complete directory structure.
I'm now looking for a command similar to --junk-paths from zip.
Code: Select all
$cfg['download_album_mime_type'] = 'application/x-tar';
$cfg['download_album_env_lang'] = '';
$cfg['download_album_extension'] = 'tar';
$cfg['download_album_cmd'] = 'tar --create --file %destination --files-from %list';
Re: Tar or Zip support for download album
Posted: Sun Jan 18, 2015 11:54 pm
by wbartels
I have changed the netjukebox code so that it will first change the to the cache directory.
And create a list file with relative file names.
This way --junk-paths or the tar counterpart is not needed anymore.
Re: Tar or Zip support for download album
Posted: Mon Jan 19, 2015 10:10 pm
by ix6tech
Excellent. This should make switching archive methods easier.
Re: Tar or Zip support for download album
Posted: Sun Mar 29, 2015 11:51 am
by wbartels
wbartels wrote:I have changed the netjukebox code so that it will first change the to the cache directory.
And create a list file with relative file names.
This way --junk-paths or the tar counterpart is not needed anymore.
Sorry this modification doesn't work for source files (without transcoding).
So I have to revert the code.
7-Zip and zip (with --junk-paths) can still be used.