Backup using tar

PHOTO EMBED

Thu May 19 2022 18:56:38 GMT+0000 (Coordinated Universal Time)

Saved by @dphillips ##shell ##backup

// Create compressed archive
tar -cvzpf <backupfile.tar.gz> <source>

// Create compressed archive excluding files and directories
tar [--exclude='file1.txt'] [--exclude='folder1'] -cvzpf <backupfile.tar.gz> <source>

// Extract archive
tar -xvf file.tar

// Extract compressed archive
tar -xzvf file.tar.gz

// Extract single directory from archive
tar -xzvf file.tar.gz etc

// -c create archive
// -v verbose
// -z compress using gzip
// -p preserve permissions
// -f file
// -x extract
content_copyCOPY

https://www.ionos.de/digitalguide/server/tools/backup-mit-tar-so-erstellen-sie-archive-unter-linux/