We are still actively working on the spam issue.

Difference between revisions of "Tarballs"

From InstallGentoo Wiki
Jump to: navigation, search
(initial page)
 
 
Line 14: Line 14:
 
  $ cd /place/to/extract/files/to
 
  $ cd /place/to/extract/files/to
 
  $ tar -zxf /wherever/tarball.tar.gz
 
  $ tar -zxf /wherever/tarball.tar.gz
 +
 +
= Create Backup =
 +
 +
tar -cf - sourcedir | ssh user@destinationserver 'cat > file.tar'
 +
 +
= Restore Backup =
 +
 +
ssh user@destinationserver 'cat file.tar' | tar -xf - -C root/dir
  
 
[[Category:Terms]]
 
[[Category:Terms]]
 
[[Category:HowTo]]
 
[[Category:HowTo]]
 
[[Category:GNU/Linux]]
 
[[Category:GNU/Linux]]

Latest revision as of 22:44, 23 September 2022

Tarballs are compressed files commonly found in GNU/Linux. The Tar (Tape Archive) utility gathers one or more files into a single .tar file. GZip then compresses the .tar file into a .tar.gz/.tgz file.

This was a common way to distribute source code before git cloning came along.

Creating a Tarball

$ cd /place/where/files/are
$ tar -czf /wherever/tarball.tar.gz file1 file2 dir1 dir2

Extracting a Tarball

$ cd /place/to/extract/files/to
$ tar -zxf /wherever/tarball.tar.gz

Create Backup

tar -cf - sourcedir | ssh user@destinationserver 'cat > file.tar'

Restore Backup

ssh user@destinationserver 'cat file.tar' | tar -xf - -C root/dir