Outline ·
[ Standard ] ·
Linear+
Compress, Exclude folder
TSUbuntuClient
|
Oct 12 2021, 07:30 PM, updated 3y ago
|
|
Hi, I try to compress and exclude folder uploads. Seems to exclude not working or i miss something. Using code below ( under /home/user) CODE tar -cvzf nama.tar.gz public_html/ --exclude='/home/myuser/public_html/wp-content/uploads/' Please advise. Thanks.
|
|
|
|
TSUbuntuClient
|
Oct 12 2021, 07:40 PM
|
|
Using this also still include the uploads folder. CODE tar -cvzf nama.tar.gz --exclude='/home/myuser/public_html/wp-content/uploads' public_html/
|
|
|
|
TSUbuntuClient
|
Oct 12 2021, 07:44 PM
|
|
Not all tutorial in internet is correct. Sometimes the writer writing without test. Now getting correct command line. CODE tar -cvzf nama.tar.gz --exclude wp-content/uploads public_html p/s: Don't believe what you see
|
|
|
|
FlierMate
|
Oct 12 2021, 07:57 PM
|
|
I tried this and it works: CODE $ tar -cvzf nama.tar.gz --exclude="public_html/wp-content/uploads" public_html
|
|
|
|
angch
|
Oct 12 2021, 08:43 PM
|
|
If you have the hardware to support it, (and the data size big enough) zstd is worth it. CODE time tar cvf - --exclude="public_html/wp-content/uploads" public_html | zstd -19 -T24 > nama.tar.zst CODE $ time tar cf - go | zstd -19 --long -T24 > go.tar.zst
real 1m7.072s user 19m49.057s sys 0m4.560s $ time tar czf go.tar.gz go
real 1m11.312s user 1m10.819s sys 0m2.665s $ time tar cf - go | xz -9 -e > go.tar.xz
real 18m5.242s user 18m4.260s sys 0m9.174s $ du -sh go go.tar.gz go.tar.zst go.tar.xz 3.2G go 1.1G go.tar.gz 584M go.tar.zst 573M go.tar.xz Faster (wall clock), and better compression. xz is smaller, but takes 18x the time. This post has been edited by angch: Oct 12 2021, 09:58 PM
|
|
|
|