Backup using tar
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
To split the tarball into multiple files of a specific size, tarsplitter from the repository https://github.com/messiaen/tarsplitter can be used (use with .tar, not with .tar,gz).
https://www.ionos.de/digitalguide/server/tools/backup-mit-tar-so-erstellen-sie-archive-unter-linux/
Comments