Error 'tar: Failed to clean up compressor' when run from cron job in FreeBSD jail

FreeBSD-12.0p10

When run as root from the command line in a jail this gives no error:

Code:
tar -czf /usr/local/www/apache24/data/hll_dav/webdav_apache24_etc.tgz  /usr/local/etc/apache24

When run as root from a cron job it gives this error:

Code:
tar -czf /usr/local/www/apache24/data/hll_dav webdav_apache24_etc.tgz /usr/local/etc/apache24
tar: Failed to clean up compressor

In both cases the archives file is created.

What is causing the error and how do I get rid of it?
 
The tarball itself ends up inside the archive, it's a loop. You're archiving /usr/local/etc/apache24 which would include /usr/local/www/apache24/data/hll_dav. Save the tarball somewhere else.
 
The tarball itself ends up inside the archive, it's a loop. You're archiving /usr/local/etc/apache24 which would include /usr/local/www/apache24/data/hll_dav. Save the tarball somewhere else.

How does /usr/local/etc/apache24 include /usr/local/www/apache24/data/hll_dav? /usr/local/etc is not in the same path as /usr/local/www.
 
And that my friend is why I'm dyslectic as I didn't spot that difference. So actually concentrating now:

Code:
tar -czf /usr/local/www/apache24/data/hll_dav/webdav_apache24_etc.tgz  /usr/local/etc/apache24
tar -czf /usr/local/www/apache24/data/hll_dav webdav_apache24_etc.tgz /usr/local/etc/apache24
Notice the space where a slash should be on the second line?
 
Back
Top