{"id":16366395,"url":"https://github.com/centminmod/tar-zstd","last_synced_at":"2025-10-26T07:30:29.107Z","repository":{"id":80280100,"uuid":"161922549","full_name":"centminmod/tar-zstd","owner":"centminmod","description":"tar custpm rpm with zstd compression support for centminmod.com LEMP stacks","archived":false,"fork":false,"pushed_at":"2024-02-05T03:54:49.000Z","size":265,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T16:41:57.035Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://centminmod.com","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/centminmod.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-12-15T16:20:50.000Z","updated_at":"2024-06-26T08:33:20.000Z","dependencies_parsed_at":"2024-02-04T14:37:45.659Z","dependency_job_id":"8e0161b8-72ff-4607-8473-9b20d7381618","html_url":"https://github.com/centminmod/tar-zstd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Ftar-zstd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Ftar-zstd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Ftar-zstd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Ftar-zstd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centminmod","download_url":"https://codeload.github.com/centminmod/tar-zstd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238284723,"owners_count":19446715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T02:46:19.594Z","updated_at":"2025-10-26T07:30:28.734Z","avatar_url":"https://github.com/centminmod.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tar custom rpm with zstd compression support\n\n* CentOS 6 \u0026 7 64bit Only\n* latest tar version with zstd compression support from [https://git.savannah.gnu.org/cgit/tar.git](https://git.savannah.gnu.org/cgit/tar.git)\n\n```\n Compression options:\n\n  -a, --auto-compress        use archive suffix to determine the compression\n                             program\n  -I, --use-compress-program=PROG\n                             filter through PROG (must accept -d)\n  -j, --bzip2                filter the archive through bzip2\n  -J, --xz                   filter the archive through xz\n      --lzip                 filter the archive through lzip\n      --lzma                 filter the archive through lzma\n      --lzop                 filter the archive through lzop\n      --no-auto-compress     do not use archive suffix to determine the\n                             compression program\n  -z, --gzip, --gunzip, --ungzip   filter the archive through gzip\n      --zstd                 filter the archive through zstd\n  -Z, --compress, --uncompress   filter the archive through compress\n```\n\n# tar zstd compression benchmarks\n\n![](/screenshots/tar-zstd-table-03.png)\n\n![](/screenshots/tar-zstd-chart-03b.png)\n\n# Install\n\nOn Centmin Mod 123.09beta01 or higher LEMP stack installs with CentOS 7.x 64bit first run centmin.sh menu option 17 to install multi-threaded compression tools including Facebook zstd compression tool.\n\n```\n--------------------------------------------------------\n     Centmin Mod Menu 123.09beta01 centminmod.com     \n--------------------------------------------------------\n1).  Centmin Install\n2).  Add Nginx vhost domain\n3).  NSD setup domain name DNS\n4).  Nginx Upgrade / Downgrade\n5).  PHP Upgrade / Downgrade\n6).  XCache Re-install\n7).  APC Cache Re-install\n8).  XCache Install\n9).  APC Cache Install\n10). Memcached Server Re-install\n11). MariaDB MySQL Upgrade \u0026 Management\n12). Zend OpCache Install/Re-install\n13). Install/Reinstall Redis PHP Extension\n14). SELinux disable\n15). Install/Reinstall ImagicK PHP Extension\n16). Change SSHD Port Number\n17). Multi-thread compression: pigz,pbzip2,lbzip2...\n18). Suhosin PHP Extension install\n19). Install FFMPEG and FFMPEG PHP Extension\n20). NSD Install/Re-Install\n21). Update - Nginx + PHP-FPM + Siege\n22). Add Wordpress Nginx vhost + Cache Plugin\n23). Update Centmin Mod Code Base\n24). Exit\n--------------------------------------------------------\nEnter option [ 1 - 24 ] 17\n```\n\n```\nzstd --version\n*** Zstandard CLI (64-bit) v1.5.5, by Yann Collet ***\n```\n\nThen install custom tar zstd supported rpm.\n\nAlmaLinux 9 for GCC 13 built tar v1.35 ** Currently Limited Testing ** [[tar v1.35 change log](https://git.savannah.gnu.org/cgit/tar.git/tree/NEWS?id=e545d446dfe6564265cdf4186641ee76f4acc7fa)]\n\n```\ncd /svr-setup\nwget https://centminmod.com/centminmodparts/tar/tar-zstd-gcc13-1.35-1.el9.x86_64.rpm -O tar-zstd-gcc13-1.35-1.el9.x86_64.rpm\nyum localinstall tar-zstd-gcc13-1.35-1.el9.x86_64.rpm\n```\n```\ntar --version\ntar (GNU tar) 1.35\nCopyright (C) 2023 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later \u003chttps://gnu.org/licenses/gpl.html\u003e.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\nWritten by John Gilmore and Jay Fenlason.\n```\n\n```\nrpm -qa --changelog tar-zstd-gcc13       \n* Sun Feb 04 2024 George Liu \u003ccentminmod.com\u003e 1.35\n- tar 1.35 zstd supported for centminmod.com LEMP stack\n```\n\n```\nyum -q info tar-zstd-gcc13.x86_64\nInstalled Packages\nName         : tar-zstd-gcc13\nVersion      : 1.35\nRelease      : 1.el9\nArchitecture : x86_64\nSize         : 3.5 M\nSource       : tar-zstd-gcc13-1.35-1.el9.src.rpm\nRepository   : @System\nFrom repo    : @commandline\nSummary      : tar 1.35 zstd supported for centminmod.com LEMP stack\nURL          : https://centminmod.com\nLicense      : unknown\nDescription  : tar 1.35 zstd supported for centminmod.com LEMP stack\n```\n\nAlmaLinux 8 for GCC 12 built tar v1.35 ** Currently Limited Testing ** [[tar v1.35 change log](https://git.savannah.gnu.org/cgit/tar.git/tree/NEWS?id=e545d446dfe6564265cdf4186641ee76f4acc7fa)]\n\n```\ncd /svr-setup\nwget https://centminmod.com/centminmodparts/tar/tar-zstd-gcc12-1.35-1.el8.x86_64.rpm -O tar-zstd-gcc12-1.35-1.el8.x86_64.rpm\nyum localinstall tar-zstd-gcc12-1.35-1.el8.x86_64.rpm\n```\n```\ntar --version\ntar (GNU tar) 1.35\nCopyright (C) 2023 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later \u003chttps://gnu.org/licenses/gpl.html\u003e.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\nWritten by John Gilmore and Jay Fenlason.\n```\n\n```\nrpm -qa --changelog tar-zstd-gcc12       \n* Sun Feb 04 2024 George Liu \u003ccentminmod.com\u003e 1.35\n- tar 1.35 zstd supported for centminmod.com LEMP stack\n```\n\n```\nyum -q info tar-zstd-gcc12.x86_64\nInstalled Packages\nName         : tar-zstd-gcc12\nVersion      : 1.35\nRelease      : 1.el8\nArchitecture : x86_64\nSize         : 3.6 M\nSource       : tar-zstd-gcc12-1.35-1.el8.src.rpm\nRepository   : @System\nFrom repo    : @commandline\nSummary      : tar 1.35 zstd supported for centminmod.com LEMP stack\nURL          : https://centminmod.com\nLicense      : unknown\nDescription  : tar 1.35 zstd supported for centminmod.com LEMP stack\n```\n\nCentOS 7 for GCC 10 built tar v1.35 ** Currently Limited Testing ** [[tar v1.35 change log](https://git.savannah.gnu.org/cgit/tar.git/tree/NEWS?id=e545d446dfe6564265cdf4186641ee76f4acc7fa)]\n\n```\ncd /svr-setup\nwget https://centminmod.com/centminmodparts/tar/tar-zstd-gcc10-1.35-1.el7.x86_64.rpm -O tar-zstd-gcc10-1.35-1.el7.x86_64.rpm\nyum localinstall tar-zstd-gcc10-1.35-1.el7.x86_64.rpm\n```\n```\ntar --version\ntar (GNU tar) 1.35\nCopyright (C) 2023 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later \u003chttps://gnu.org/licenses/gpl.html\u003e.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\nWritten by John Gilmore and Jay Fenlason.\n```\n\n```\nrpm -qa --changelog tar-zstd-gcc10       \n* Sun Feb 04 2024 George Liu \u003ccentminmod.com\u003e 1.35\n- tar 1.35 zstd supported for centminmod.com LEMP stack\n```\n\n```\nyum -q info tar-zstd-gcc10.x86_64\nInstalled Packages\nName        : tar-zstd-gcc10\nArch        : x86_64\nVersion     : 1.35\nRelease     : 1.el7\nSize        : 3.6 M\nRepo        : installed\nFrom repo   : /tar-zstd-gcc10-1.35-1.el7.x86_64\nSummary     : tar 1.35 zstd supported for centminmod.com LEMP stack\nURL         : https://centminmod.com\nLicense     : unknown\nDescription : tar 1.35 zstd supported for centminmod.com LEMP stack\n```\n\nFor GCC 11 built tar v1.34 with additionally synced master branch fixes \u0026 for GCC 11 compatibility ** Currently Limited Testing **\n\n```\ncd /svr-setup\nwget https://centminmod.com/centminmodparts/tar/tar-zstd-gcc11-2021.10.13-1.34-1.el7.x86_64.rpm -O tar-zstd-gcc11-2021.10.13-1.34-1.el7.x86_64.rpm\nyum localinstall tar-zstd-gcc11-2021.10.13-1.34-1.el7.x86_64.rpm\n```\n```\ntar --version\ntar (GNU tar) 1.34\nCopyright (C) 2021 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later \u003chttps://gnu.org/licenses/gpl.html\u003e.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\nWritten by John Gilmore and Jay Fenlason.\n```\n\n```\nrpm -qa --changelog tar-zstd-gcc11-2021.10.13\n* Sun Dec 05 2021 George Liu \u003ccentminmod.com\u003e 1.34\n- tar 1.34 2021.10.13 zstd supported for centminmod.com LEMP stack\n- latest tar git master build 2021.10.13\n\n* Sun Dec 05 2021 George Liu \u003ccentminmod.com\u003e 1.34\n- Fix extraction over pipe (savannah bug #60002)\n- Fix memory leak in read_header (savannah bug #59897)\n- Fix extraction when . and .. are unreadable\n  See https://lists.gnu.org/archive/html/bug-tar/2021-01/msg00012.html\n- Gracefully handle duplicate symlinks when extracting\n  See https://lists.gnu.org/archive/html/bug-tar/2021-01/msg00026.html\n- Re-initialize supplementary groups when switching to user privileges\n```\n\n```\nyum -q info tar-zstd-gcc11-2021.10.13\nInstalled Packages\nName        : tar-zstd-gcc11-2021.10.13\nArch        : x86_64\nVersion     : 1.34\nRelease     : 1.el7\nSize        : 3.5 M\nRepo        : installed\nFrom repo   : /tar-zstd-gcc11-2021.10.13-1.34-1.el7.x86_64\nSummary     : tar 1.34 zstd supported for centminmod.com LEMP stack\nURL         : https://centminmod.com\nLicense     : unknown\nDescription : tar 1.34 zstd supported for centminmod.com LEMP stack\n```\n\nFor GCC 9 built tar v1.34 ** Currently Limited Testing **\n\n```\ncd /svr-setup\nwget https://centminmod.com/centminmodparts/tar/tar-zstd-gcc9-1.34-1.el7.x86_64.rpm -O tar-zstd-gcc9-1.34-1.el7.x86_64.rpm\nyum localinstall tar-zstd-gcc9-1.34-1.el7.x86_64.rpm\n```\n```\ntar --version\ntar (GNU tar) 1.34\nCopyright (C) 2021 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later \u003chttps://gnu.org/licenses/gpl.html\u003e.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\nWritten by John Gilmore and Jay Fenlason.\n```\n\n```\nrpm -qa --changelog tar-zstd-gcc9\n* Sun Dec 05 2021 George Liu \u003ccentminmod.com\u003e 1.34\n- tar 1.34 zstd supported for centminmod.com LEMP stack\n- Fix extraction over pipe (savannah bug #60002)\n- Fix memory leak in read_header (savannah bug #59897)\n- Fix extraction when . and .. are unreadable\n  See https://lists.gnu.org/archive/html/bug-tar/2021-01/msg00012.html\n- Gracefully handle duplicate symlinks when extracting\n  See https://lists.gnu.org/archive/html/bug-tar/2021-01/msg00026.html\n- Re-initialize supplementary groups when switching to user privileges\n```\n\n```\nyum -q info tar-zstd-gcc9.x86_64\nInstalled Packages\nName        : tar-zstd-gcc9\nArch        : x86_64\nVersion     : 1.34\nRelease     : 1.el7\nSize        : 3.5 M\nRepo        : installed\nFrom repo   : /tar-zstd-gcc9-1.34-1.el7.x86_64\nSummary     : tar 1.34 zstd supported for centminmod.com LEMP stack\nURL         : https://centminmod.com\nLicense     : unknown\nDescription : tar 1.34 zstd supported for centminmod.com LEMP stack\n```\n\nFor GCC 9 built tar v1.33 ** Currently Limited Testing **\n\n```\ncd /svr-setup\nwget https://centminmod.com/centminmodparts/tar/tar-zstd-gcc9-1.33-1.el7.x86_64.rpm -O tar-zstd-gcc9-1.33-1.el7.x86_64.rpm\nyum localinstall tar-zstd-gcc9-1.33-1.el7.x86_64.rpm\n```\n```\ntar --version\ntar (GNU tar) 1.33\nCopyright (C) 2021 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later \u003chttps://gnu.org/licenses/gpl.html\u003e.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n```\n\n```\nrpm -qa --changelog tar-zstd-gcc9\n* Mon Jan 25 2021 George Liu \u003ccentminmod.com\u003e 1.33\n- tar 1.33 zstd supported for centminmod.com LEMP stack\n- Fix memory leak in read_header CVE-2021-20193 patch fixed\n```\n\n```\nyum -q info tar-zstd-gcc9.x86_64\nInstalled Packages\nName        : tar-zstd-gcc9\nArch        : x86_64\nVersion     : 1.33\nRelease     : 1.el7\nSize        : 3.5 M\nRepo        : installed\nFrom repo   : /tar-zstd-gcc9-1.33-1.el7.x86_64\nSummary     : tar 1.33 zstd supported for centminmod.com LEMP stack\nURL         : https://centminmod.com\nLicense     : unknown\nDescription : tar 1.33 zstd supported for centminmod.com LEMP stack\n```\n\nFor GCC 8 built\n\n```\ncd /svr-setup\nwget https://centminmod.com/centminmodparts/tar/tar-zstd-gcc8-1.32-1.el7.x86_64.rpm -O tar-zstd-gcc8-1.32-1.el7.x86_64.rpm\nyum localinstall tar-zstd-gcc8-1.32-1.el7.x86_64.rpm\n```\n\nFor GCC 7 built\n\n```\ncd /svr-setup\nwget https://centminmod.com/centminmodparts/tar/tar-zstd-gcc7-1.32-1.el7.x86_64.rpm -O tar-zstd-gcc7-1.32-1.el7.x86_64.rpm\nyum localinstall tar-zstd-gcc7-1.32-1.el7.x86_64.rpm\n```\n\n```\nyum localinstall tar-zstd-gcc8-1.32-1.el7.x86_64.rpm\nLoaded plugins: fastestmirror, priorities, versionlock\nExamining /svr-setup/tar-zstd-gcc8-1.32-1.el7.x86_64.rpm: tar-zstd-gcc8-1.32-1.el7.x86_64\nMarking /svr-setup/tar-zstd-gcc8-1.32-1.el7.x86_64.rpm to be installed\nResolving Dependencies\n--\u003e Running transaction check\n---\u003e Package tar-zstd-gcc8.x86_64 0:1.32-1.el7 will be installed\n--\u003e Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package         Arch     Version      Repository                          Size\n================================================================================\nInstalling:\n tar-zstd-gcc8   x86_64   1.32-1.el7   /tar-zstd-gcc8-1.32-1.el7.x86_64   3.5 M\n\nTransaction Summary\n================================================================================\nInstall  1 Package\n\nTotal size: 3.5 M\nInstalled size: 3.5 M\nDownloading packages:\nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n  Installing : tar-zstd-gcc8-1.32-1.el7.x86_64                              1/1 \n  Verifying  : tar-zstd-gcc8-1.32-1.el7.x86_64                              1/1 \n\nInstalled:\n  tar-zstd-gcc8.x86_64 0:1.32-1.el7                                             \n\nComplete!\n```\n\n# Usage\n\nCreate a tar archive compressed with zstd\n\n```\ntar -caf directory.tar.zst directory/\n```\n\nDecompress zstd compressed archive\n\n```\ntar -xaf directory.tar.zst\n```\n\nOr create tar archive with custom zstd compression level = 4 cpu thread zstd test at level 3 compression\n\n```\ntar \"-I zstd -3 -T4\" -cf directory.tar.zst directory/\n```\n\nWith [zstd Long Range Mode flag](https://community.centminmod.com/threads/custom-tar-archiver-rpm-build-with-facebook-zstd-compression-support.16243/#post-69530) `--long=27` mode for 128MB window\n\n```\ntar \"-I zstd -3 -T4 --long=27\" -cf directory.tar.zst directory/\n```\n\nWith `--long=31` mode for 2GB window\n\n```\ntar \"-I zstd -3 -T4 --long=31\" -cf directory.tar.zst directory/\n```\n\nExample for backing up Centmin Mod LEMP stack's `/home/nginx/domains/domain.com` Nginx vhost site data files for `domain.com` outlined at https://community.centminmod.com/threads/custom-tar-archiver-rpm-build-with-facebook-zstd-compression-support.16243/#post-69535\n\n```\nDT=$(date +\"%d%m%y-%H%M%S\")\nvhostname='domain.com'\nbackupdir='/home/nginx-backup-sites'\nif [[ \"$(awk '/MemFree/ {print $2}' /proc/meminfo)\" -ge '2500000' ]]; then long=31; else long=27; fi\npushd /home/nginx/domains/ \u0026\u0026 mkdir -p \"${backupdir}\"\ntime tar \"-I zstd -3 -T0 --long=${long} --adapt\" --exclude=log/* --exclude=backup/* -cpf \"${backupdir}/${vhostname}-${DT}.tar.zst\" ${vhostname}\nfs=$(ls -lAh \"${backupdir}/${vhostname}-${DT}.tar.zst\" | awk '{print $5,$9}') \u0026\u0026 echo \"$fs\"\npopd \u0026\u0026 echo \"backup ${vhostname} files only complete at ${backupdir}/${vhostname}-${DT}.tar.zst\"\n```\n\n1. 1st line assigns to DT variable a date timestamp which is appended to your tar.zst backup file\n2. 2nd line for vhostname variable assigns variable for intended domain name you want to backup\n3. 3rd line assigns backupdir variable the directory where you want to save your tar.zst backup file\n4. 4th line determines which zstd long range method is used depending on how much free memory you have available. So if you have more than 2,500,000 KB free memory, zstd will use long range method with --long=31 for 2GB window. If you have less than 2,500,00 KB free memory, zstd will use long range method with --long=27 for 128MB window.\n5. 5th line uses pushd to change into /home/nginx/domains directory and create the backup directory set on 3rd line's backupdir variable\n6. 6th line, timed tar + zstd backup and compression which also uses zstd automatic level determination --adapt flag and -T0 meaning use all cpu cores. Tar also excludes contents of /home/nginx/domains/domain.com/log and /home/nginx/domains/domain.com/backup directories\n7. 7th line assigns to fs variable size and full path name of resulting tar.zst backup file and prints that out via echo command\n8. 8th line uses popd to return you to whatever directory you were in prior to pushd command on line 5 above and prints out completion message and full path to tar.zst backup file\n\nListing of tar.zst backup compressed files\n\n```\nls -lah /home/nginx-backup-sites           \ntotal 32K\ndrwxr-xr-x   2 root root 4.0K Dec 20 02:03 .\ndrwxr-xr-x. 31 root root 4.0K Dec 20 01:01 ..\n-rw-r--r--   1 root root  12K Dec 20 01:08 domain.com-201218-010827.tar.zst\n-rw-r--r--   1 root root  12K Dec 20 01:35 domain.com-201218-013419.tar.zst\n```\n\nTo restore Centmin Mod Nginx vhost backup file outlined at https://community.centminmod.com/threads/custom-tar-archiver-rpm-build-with-facebook-zstd-compression-support.16243/#post-69535\n\nEdit and assign to backupfile variable the full path to the backup file you want to restore from the backup commands you ran above.\n\n```\nDT=$(date +\"%d%m%y-%H%M%S\")\nbackupfile='/home/nginx-backup-sites/domain.com-201218-010827.tar.zst'\nvhostname='domain.com'\nrestoredir=\"/home/nginx/domains/${vhostname}-restored-${DT}\"\nmkdir -p ${restoredir}\nif [[ \"$(awk '/MemFree/ {print $2}' /proc/meminfo)\" -ge '2500000' ]]; then long=31; else long=27; fi\ntime tar \"-I zstd -d -T0 --long=${long}\" -xvf ${backupfile} -C ${restoredir}\necho \"diff compare restore versus existing directories\"\ndiff -r /home/nginx/domains/${vhostname} ${restoredir}/${vhostname}\necho \"restored ${vhostname} files to ${restoredir}\"\n```\n\n1. 1st line assigns to backupfile variable the full path to the backup file you want to restore from the backup commands you ran above.\n2. 2nd line for vhostname variable assigns variable for intended domain name you intend to restore to\n3. 3rd line assigns restoredir variable the directory where the backup tar.zst files' contents will be restored to. You can then compare or sync directory/files with the existing version of the nginx vhost or move the restored files to replace existing version of the nginx vhost\n4. 4th line creates the restore directory assigned to restoredir variable if it doesn't exist\n5. 5th line determines which zstd long range method is used depending on how much free memory you have available. So if you have more than 2,500,000 KB free memory, zstd will use long range method with --long=31 for 2GB window. If you have less than 2,500,00 KB free memory, zstd will use long range method with --long=27 for 128MB window.\n6. 6th line run timed tar decompress and extraction with zstd with all cpu cores and extract to restore directory\n7. 7th \u0026 8th lines print out the differences only between restored directory from tar.zst backup and the existing nginx vhost site\n9. 9th line, restore completion message\n\nlisting in /home/nginx/domains/ with existing nginx vhost directory and restored version\n\n```\nls -lah /home/nginx/domains/ | grep ${vhostname}\ndrwxr-s---   6 nginx nginx 4.0K Dec 20 01:04 domain.com\ndrwxr-sr-x   3 root  nginx 4.0K Dec 20 01:36 domain.com-restored-201218-013419\n```\n\n# RPM Info\n\n```\ntar --version\ntar (GNU tar) 1.32\nCopyright (C) 2019 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later \u003chttps://gnu.org/licenses/gpl.html\u003e.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\nWritten by John Gilmore and Jay Fenlason.\n```\n\nCentOS 7\n\nBuilt with GCC 8\n\n```\nyum -q info tar-zstd-gcc8\nInstalled Packages\nName        : tar-zstd-gcc8\nArch        : x86_64\nVersion     : 1.32\nRelease     : 1.el7\nSize        : 3.5 M\nRepo        : installed\nFrom repo   : /tar-zstd-gcc8-1.32-1.el7.x86_64\nSummary     : tar 1.32 zstd supported for centminmod.com LEMP stack\nURL         : https://centminmod.com\nLicense     : unknown\nDescription : tar 1.32 zstd supported for centminmod.com LEMP stack\n```\n\nBuilt with GCC 7\n\n```\nyum -q info tar-zstd-gcc7\nInstalled Packages\nName        : tar-zstd-gcc7\nArch        : x86_64\nVersion     : 1.32\nRelease     : 1.el7\nSize        : 3.5 M\nRepo        : installed\nSummary     : tar 1.32 zstd supported for centminmod.com LEMP stack\nURL         : https://centminmod.com\nLicense     : unknown\nDescription : tar 1.32 zstd supported for centminmod.com LEMP stack\n```\n\nCentOS 6\n\n```\nyum -q info tar-zstd-gcc7\nInstalled Packages\nName        : tar-zstd-gcc7\nArch        : x86_64\nVersion     : 1.32\nRelease     : 1.el6\nSize        : 3.5 M\nRepo        : installed\nFrom repo   : /tar-zstd-gcc7-1.32-1.el6.x86_64\nSummary     : tar 1.32 zstd supported for centminmod.com LEMP stack\nURL         : https://centminmod.com\nLicense     : unknown\nDescription : tar 1.32 zstd supported for centminmod.com LEMP stack\n```\n\nFor GCC 8 built\n\n```\nrpm -qa --changelog tar-zstd-gcc8\n* Sat May 23 2020 George Liu \u003ccentminmod.com\u003e 1.32\n- tar 1.32 zstd supported for centminmod.com LEMP stack\n```\n\nFor GCC 7 built\n\n```\nrpm -qa --changelog tar-zstd-gcc7\n* Tue Feb 26 2019 George Liu \u003ccentminmod.com\u003e 1.32\n- tar 1.32 zstd supported for centminmod.com LEMP stack\n```\n\n```\nrpm -ql tar-zstd-gcc7\n/usr/local/bin/tar\n/usr/local/libexec/rmt\n/usr/local/share/info/dir\n/usr/local/share/info/tar.info\n/usr/local/share/info/tar.info-1\n/usr/local/share/info/tar.info-2\n/usr/local/share/locale/bg/LC_MESSAGES/tar.mo\n/usr/local/share/locale/ca/LC_MESSAGES/tar.mo\n/usr/local/share/locale/cs/LC_MESSAGES/tar.mo\n/usr/local/share/locale/da/LC_MESSAGES/tar.mo\n/usr/local/share/locale/de/LC_MESSAGES/tar.mo\n/usr/local/share/locale/el/LC_MESSAGES/tar.mo\n/usr/local/share/locale/eo/LC_MESSAGES/tar.mo\n/usr/local/share/locale/es/LC_MESSAGES/tar.mo\n/usr/local/share/locale/et/LC_MESSAGES/tar.mo\n/usr/local/share/locale/eu/LC_MESSAGES/tar.mo\n/usr/local/share/locale/fi/LC_MESSAGES/tar.mo\n/usr/local/share/locale/fr/LC_MESSAGES/tar.mo\n/usr/local/share/locale/ga/LC_MESSAGES/tar.mo\n/usr/local/share/locale/gl/LC_MESSAGES/tar.mo\n/usr/local/share/locale/hr/LC_MESSAGES/tar.mo\n/usr/local/share/locale/hu/LC_MESSAGES/tar.mo\n/usr/local/share/locale/id/LC_MESSAGES/tar.mo\n/usr/local/share/locale/it/LC_MESSAGES/tar.mo\n/usr/local/share/locale/ja/LC_MESSAGES/tar.mo\n/usr/local/share/locale/ko/LC_MESSAGES/tar.mo\n/usr/local/share/locale/ky/LC_MESSAGES/tar.mo\n/usr/local/share/locale/ms/LC_MESSAGES/tar.mo\n/usr/local/share/locale/nb/LC_MESSAGES/tar.mo\n/usr/local/share/locale/nl/LC_MESSAGES/tar.mo\n/usr/local/share/locale/pl/LC_MESSAGES/tar.mo\n/usr/local/share/locale/pt/LC_MESSAGES/tar.mo\n/usr/local/share/locale/pt_BR/LC_MESSAGES/tar.mo\n/usr/local/share/locale/ro/LC_MESSAGES/tar.mo\n/usr/local/share/locale/ru/LC_MESSAGES/tar.mo\n/usr/local/share/locale/sk/LC_MESSAGES/tar.mo\n/usr/local/share/locale/sl/LC_MESSAGES/tar.mo\n/usr/local/share/locale/sr/LC_MESSAGES/tar.mo\n/usr/local/share/locale/sv/LC_MESSAGES/tar.mo\n/usr/local/share/locale/tr/LC_MESSAGES/tar.mo\n/usr/local/share/locale/uk/LC_MESSAGES/tar.mo\n/usr/local/share/locale/vi/LC_MESSAGES/tar.mo\n/usr/local/share/locale/zh_CN/LC_MESSAGES/tar.mo\n/usr/local/share/locale/zh_TW/LC_MESSAGES/tar.mo\n/usr/local/share/man/man1/tar.1\n/usr/local/share/man/man8/rmt.8\n```\n\n```\ntar --help\nUsage: tar [OPTION...] [FILE]...\nGNU 'tar' saves many files together into a single tape or disk archive, and can\nrestore individual files from the archive.\n\nExamples:\n  tar -cf archive.tar foo bar  # Create archive.tar from files foo and bar.\n  tar -tvf archive.tar         # List all files in archive.tar verbosely.\n  tar -xf archive.tar          # Extract all files from archive.tar.\n\n Local file name selection:\n\n      --add-file=FILE        add given FILE to the archive (useful if its name\n                             starts with a dash)\n  -C, --directory=DIR        change to directory DIR\n      --exclude=PATTERN      exclude files, given as a PATTERN\n      --exclude-backups      exclude backup and lock files\n      --exclude-caches       exclude contents of directories containing\n                             CACHEDIR.TAG, except for the tag file itself\n      --exclude-caches-all   exclude directories containing CACHEDIR.TAG\n      --exclude-caches-under exclude everything under directories containing\n                             CACHEDIR.TAG\n      --exclude-ignore=FILE  read exclude patterns for each directory from\n                             FILE, if it exists\n      --exclude-ignore-recursive=FILE\n                             read exclude patterns for each directory and its\n                             subdirectories from FILE, if it exists\n      --exclude-tag=FILE     exclude contents of directories containing FILE,\n                             except for FILE itself\n      --exclude-tag-all=FILE exclude directories containing FILE\n      --exclude-tag-under=FILE   exclude everything under directories\n                             containing FILE\n      --exclude-vcs          exclude version control system directories\n      --exclude-vcs-ignores  read exclude patterns from the VCS ignore files\n      --no-null              disable the effect of the previous --null option\n      --no-recursion         avoid descending automatically in directories\n      --no-unquote           do not unquote input file or member names\n      --no-verbatim-files-from   -T treats file names starting with dash as\n                             options (default)\n      --null                 -T reads null-terminated names; implies\n                             --verbatim-files-from\n      --recursion            recurse into directories (default)\n  -T, --files-from=FILE      get names to extract or create from FILE\n      --unquote              unquote input file or member names (default)\n      --verbatim-files-from  -T reads file names verbatim (no escape or option\n                             handling)\n  -X, --exclude-from=FILE    exclude patterns listed in FILE\n\n File name matching options (affect both exclude and include patterns):\n\n      --anchored             patterns match file name start\n      --ignore-case          ignore case\n      --no-anchored          patterns match after any '/' (default for\n                             exclusion)\n      --no-ignore-case       case sensitive matching (default)\n      --no-wildcards         verbatim string matching\n      --no-wildcards-match-slash   wildcards do not match '/'\n      --wildcards            use wildcards (default for exclusion)\n      --wildcards-match-slash   wildcards match '/' (default for exclusion)\n\n Main operation mode:\n\n  -A, --catenate, --concatenate   append tar files to an archive\n  -c, --create               create a new archive\n  -d, --diff, --compare      find differences between archive and file system\n      --delete               delete from the archive (not on mag tapes!)\n  -r, --append               append files to the end of an archive\n  -t, --list                 list the contents of an archive\n      --test-label           test the archive volume label and exit\n  -u, --update               only append files newer than copy in archive\n  -x, --extract, --get       extract files from an archive\n\n Operation modifiers:\n\n      --check-device         check device numbers when creating incremental\n                             archives (default)\n  -g, --listed-incremental=FILE   handle new GNU-format incremental backup\n  -G, --incremental          handle old GNU-format incremental backup\n      --hole-detection=TYPE  technique to detect holes\n      --ignore-failed-read   do not exit with nonzero on unreadable files\n      --level=NUMBER         dump level for created listed-incremental archive\n  -n, --seek                 archive is seekable\n      --no-check-device      do not check device numbers when creating\n                             incremental archives\n      --no-seek              archive is not seekable\n      --occurrence[=NUMBER]  process only the NUMBERth occurrence of each file\n                             in the archive; this option is valid only in\n                             conjunction with one of the subcommands --delete,\n                             --diff, --extract or --list and when a list of\n                             files is given either on the command line or via\n                             the -T option; NUMBER defaults to 1\n      --sparse-version=MAJOR[.MINOR]\n                             set version of the sparse format to use (implies\n                             --sparse)\n  -S, --sparse               handle sparse files efficiently\n\n Overwrite control:\n\n  -k, --keep-old-files       don't replace existing files when extracting,\n                             treat them as errors\n      --keep-directory-symlink   preserve existing symlinks to directories when\n                             extracting\n      --keep-newer-files     don't replace existing files that are newer than\n                             their archive copies\n      --no-overwrite-dir     preserve metadata of existing directories\n      --one-top-level[=DIR]  create a subdirectory to avoid having loose files\n                             extracted\n      --overwrite            overwrite existing files when extracting\n      --overwrite-dir        overwrite metadata of existing directories when\n                             extracting (default)\n      --recursive-unlink     empty hierarchies prior to extracting directory\n      --remove-files         remove files after adding them to the archive\n      --skip-old-files       don't replace existing files when extracting,\n                             silently skip over them\n  -U, --unlink-first         remove each file prior to extracting over it\n  -W, --verify               attempt to verify the archive after writing it\n\n Select output stream:\n\n      --ignore-command-error ignore exit codes of children\n      --no-ignore-command-error   treat non-zero exit codes of children as\n                             error\n  -O, --to-stdout            extract files to standard output\n      --to-command=COMMAND   pipe extracted files to another program\n\n Handling of file attributes:\n\n      --atime-preserve[=METHOD]   preserve access times on dumped files, either\n                             by restoring the times after reading\n                             (METHOD='replace'; default) or by not setting the\n                             times in the first place (METHOD='system')\n      --clamp-mtime          only set time when the file is more recent than\n                             what was given with --mtime\n      --delay-directory-restore   delay setting modification times and\n                             permissions of extracted directories until the end\n                             of extraction\n      --group=NAME           force NAME as group for added files\n      --group-map=FILE       use FILE to map file owner GIDs and names\n      --mode=CHANGES         force (symbolic) mode CHANGES for added files\n      --mtime=DATE-OR-FILE   set mtime for added files from DATE-OR-FILE\n  -m, --touch                don't extract file modified time\n      --no-delay-directory-restore\n                             cancel the effect of --delay-directory-restore\n                             option\n      --no-same-owner        extract files as yourself (default for ordinary\n                             users)\n      --no-same-permissions  apply the user's umask when extracting permissions\n                             from the archive (default for ordinary users)\n      --numeric-owner        always use numbers for user/group names\n      --owner=NAME           force NAME as owner for added files\n      --owner-map=FILE       use FILE to map file owner UIDs and names\n  -p, --preserve-permissions, --same-permissions\n                             extract information about file permissions\n                             (default for superuser)\n      --same-owner           try extracting files with the same ownership as\n                             exists in the archive (default for superuser)\n  -s, --preserve-order, --same-order\n                             member arguments are listed in the same order as\n                             the files in the archive\n      --sort=ORDER           directory sorting order: none (default), name or\n                             inode\n\n Handling of extended file attributes:\n\n      --acls                 Enable the POSIX ACLs support\n      --no-acls              Disable the POSIX ACLs support\n      --no-selinux           Disable the SELinux context support\n      --no-xattrs            Disable extended attributes support\n      --selinux              Enable the SELinux context support\n      --xattrs               Enable extended attributes support\n      --xattrs-exclude=MASK  specify the exclude pattern for xattr keys\n      --xattrs-include=MASK  specify the include pattern for xattr keys\n\n Device selection and switching:\n\n  -f, --file=ARCHIVE         use archive file or device ARCHIVE\n      --force-local          archive file is local even if it has a colon\n  -F, --info-script=NAME, --new-volume-script=NAME\n                             run script at end of each tape (implies -M)\n  -L, --tape-length=NUMBER   change tape after writing NUMBER x 1024 bytes\n  -M, --multi-volume         create/list/extract multi-volume archive\n      --rmt-command=COMMAND  use given rmt COMMAND instead of rmt\n      --rsh-command=COMMAND  use remote COMMAND instead of rsh\n      --volno-file=FILE      use/update the volume number in FILE\n\n Device blocking:\n\n  -b, --blocking-factor=BLOCKS   BLOCKS x 512 bytes per record\n  -B, --read-full-records    reblock as we read (for 4.2BSD pipes)\n  -i, --ignore-zeros         ignore zeroed blocks in archive (means EOF)\n      --record-size=NUMBER   NUMBER of bytes per record, multiple of 512\n\n Archive format selection:\n\n  -H, --format=FORMAT        create archive of the given format\n\n FORMAT is one of the following:\n\n    gnu                      GNU tar 1.13.x format\n    oldgnu                   GNU format as per tar \u003c= 1.12\n    pax                      POSIX 1003.1-2001 (pax) format\n    posix                    same as pax\n    ustar                    POSIX 1003.1-1988 (ustar) format\n    v7                       old V7 tar format\n\n      --old-archive, --portability\n                             same as --format=v7\n      --pax-option=keyword[[:]=value][,keyword[[:]=value]]...\n                             control pax keywords\n      --posix                same as --format=posix\n  -V, --label=TEXT           create archive with volume name TEXT; at\n                             list/extract time, use TEXT as a globbing pattern\n                             for volume name\n\n Compression options:\n\n  -a, --auto-compress        use archive suffix to determine the compression\n                             program\n  -I, --use-compress-program=PROG\n                             filter through PROG (must accept -d)\n  -j, --bzip2                filter the archive through bzip2\n  -J, --xz                   filter the archive through xz\n      --lzip                 filter the archive through lzip\n      --lzma                 filter the archive through lzma\n      --lzop                 filter the archive through lzop\n      --no-auto-compress     do not use archive suffix to determine the\n                             compression program\n  -z, --gzip, --gunzip, --ungzip   filter the archive through gzip\n      --zstd                 filter the archive through zstd\n  -Z, --compress, --uncompress   filter the archive through compress\n\n Local file selection:\n\n      --backup[=CONTROL]     backup before removal, choose version CONTROL\n  -h, --dereference          follow symlinks; archive and dump the files they\n                             point to\n      --hard-dereference     follow hard links; archive and dump the files they\n                             refer to\n  -K, --starting-file=MEMBER-NAME\n                             begin at member MEMBER-NAME when reading the\n                             archive\n      --newer-mtime=DATE     compare date and time when data changed only\n  -N, --newer=DATE-OR-FILE, --after-date=DATE-OR-FILE\n                             only store files newer than DATE-OR-FILE\n      --one-file-system      stay in local file system when creating archive\n  -P, --absolute-names       don't strip leading '/'s from file names\n      --suffix=STRING        backup before removal, override usual suffix ('~'\n                             unless overridden by environment variable\n                             SIMPLE_BACKUP_SUFFIX)\n\n File name transformations:\n\n      --strip-components=NUMBER   strip NUMBER leading components from file\n                             names on extraction\n      --transform=EXPRESSION, --xform=EXPRESSION\n                             use sed replace EXPRESSION to transform file\n                             names\n\n Informative output:\n\n      --checkpoint[=NUMBER]  display progress messages every NUMBERth record\n                             (default 10)\n      --checkpoint-action=ACTION   execute ACTION on each checkpoint\n      --full-time            print file time to its full resolution\n      --index-file=FILE      send verbose output to FILE\n  -l, --check-links          print a message if not all links are dumped\n      --no-quote-chars=STRING   disable quoting for characters from STRING\n      --quote-chars=STRING   additionally quote characters from STRING\n      --quoting-style=STYLE  set name quoting style; see below for valid STYLE\n                             values\n  -R, --block-number         show block number within archive with each message\n                            \n      --show-defaults        show tar defaults\n      --show-omitted-dirs    when listing or extracting, list each directory\n                             that does not match search criteria\n      --show-snapshot-field-ranges\n                             show valid ranges for snapshot-file fields\n      --show-transformed-names, --show-stored-names\n                             show file or archive names after transformation\n      --totals[=SIGNAL]      print total bytes after processing the archive;\n                             with an argument - print total bytes when this\n                             SIGNAL is delivered; Allowed signals are: SIGHUP,\n                             SIGQUIT, SIGINT, SIGUSR1 and SIGUSR2; the names\n                             without SIG prefix are also accepted\n      --utc                  print file modification times in UTC\n  -v, --verbose              verbosely list files processed\n      --warning=KEYWORD      warning control\n  -w, --interactive, --confirmation\n                             ask for confirmation for every action\n\n Compatibility options:\n\n  -o                         when creating, same as --old-archive; when\n                             extracting, same as --no-same-owner\n\n Other options:\n\n  -?, --help                 give this help list\n      --restrict             disable use of some potentially harmful options\n      --usage                give a short usage message\n      --version              print program version\n\nMandatory or optional arguments to long options are also mandatory or optional\nfor any corresponding short options.\n\nThe backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\nThe version control may be set with --backup or VERSION_CONTROL, values are:\n\n  none, off       never make backups\n  t, numbered     make numbered backups\n  nil, existing   numbered if numbered backups exist, simple otherwise\n  never, simple   always make simple backups\n\nValid arguments for the --quoting-style option are:\n\n  literal\n  shell\n  shell-always\n  shell-escape\n  shell-escape-always\n  c\n  c-maybe\n  escape\n  locale\n  clocale\n\n*This* tar defaults to:\n--format=gnu -f- -b20 --quoting-style=escape\n--rmt-command=/usr/local/libexec/rmt\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Ftar-zstd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentminmod%2Ftar-zstd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Ftar-zstd/lists"}