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.

Ubuntu e.g. 16.04:

tar -czfp 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