[[tar]]

tar

Use ssh to tar a directory on a remote host to a local directory:

cd /usr/src/somedir
ssh host.domain.tld "tar -czv -C /usr/src/somedir -f - ." | tar xzf -

- or -

cd /usr/src
ssh host.domain.tld "tar -czv -C /usr/src -f - otherdir/" | tar xzf -

this would create “otherdir” in /usr/src

encrypt/decrypt a tar archive

# create the encrypted archive:
tar cz folder_to_backup | openssl enc -aes-256 -e > encrypted.tgz.enc
 
# use a file to store the password (required if used via cron)
tar cz folder_to_backup | openssl enc -aes-256 -pass file:/path/to/pwfile -e > encrypted.tgz.enc
 
# show contents of archive:
openssl aes-256-cbc -d -in encrypted.tgz.enc | tar tzf -
 
# extract the encrypted archive:
openssl aes-256-cbc -d -in encrypted.tgz.enc | tar xzf -
# or create an decrypted version of the archive:
openssl aes-256-cbc -d -in encrypted.tgz.enc -out decrypted.tgz
linux/tar.txt · Last modified: 2013-04 by tb
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready