linux:tar
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| linux:tar [2016/05/19 17:10] – created Wuff | linux:tar [2024/10/22 12:49] (current) – [Tar/gzip examples] Wuff | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Tar examples ====== | + | ====== Tar/gzip examples ====== |
| Add multiple specific files into a single compressed tarball: | Add multiple specific files into a single compressed tarball: | ||
| < | < | ||
| tar czf archive.tar.gz / | tar czf archive.tar.gz / | ||
| + | </ | ||
| + | |||
| + | |||
| + | Backup of directory on remote server to local server via ssh | ||
| + | < | ||
| + | ssh root@server "(cd / | ||
| + | </ | ||
| + | |||
| + | Backup of a directory on local system, storing on remote system | ||
| + | < | ||
| + | tar zcvf - / | ||
| + | </ | ||
| + | |||
| + | Extract remote archive to local system: | ||
| + | < | ||
| + | |||
| + | ===== Complete dd disk image ===== | ||
| + | |||
| + | Complete disk image of remote server to local compressed image file via ssh | ||
| + | < | ||
| + | #from local server | ||
| + | ssh root@server "(dd bs=32M if=/dev/sda status=progress | gzip -9)" | dd of=./ | ||
| + | |||
| + | #from remote server onto local server: | ||
| + | dd bs=32M if=/dev/sda status=progress | gzip -9 | ssh root@20.30.40.50 "dd of=/ | ||
| + | </ | ||
| + | |||
| + | Restore of local compressed disk image to remote server via ssh | ||
| + | < | ||
| + | gunzip -c / | ||
| </ | </ | ||
linux/tar.1463674239.txt.gz · Last modified: (external edit)