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



## byrnejb (Oct 7, 2019)

FreeBSD-12.0p10

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


```
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:


```
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?


----------



## SirDice (Oct 8, 2019)

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.


----------



## byrnejb (Oct 8, 2019)

SirDice said:


> 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.


----------



## SirDice (Oct 8, 2019)

And that my friend is why I'm dyslectic as I didn't spot that difference. So actually concentrating now:


```
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?


----------



## byrnejb (Oct 9, 2019)

Yes, I made the same type of mistake.


----------

