Creating a gzipped Tar-archive with permission info

Submitted by Peter Majmesku on Wed, 01/10/2018 - 08:44

This depends on the operating system (see all tar options: https://www.gnu.org/software/tar/manual/html_section/tar_22.html).

Ubuntu e.g. 16.04:

tar -czf files.tar.gz docroot/docroot/sites/default/files/*

An alternative approach is to just create a Gzip archive. The command will remove the former file and create a Gzip archive out of it (results in "database-dump.sql.gz"):

gzip database-dump.sql
Tags