Skip to content

Compress, copy and unzip folder via ssh

An example to compress, Copy and unzip the contents of a folder in ssh are the next steps:

tar -zcf backup.tar.gz httpdocs/ (would httpdocs folder to compress)

-scp backup.tar.gz root@host:/var/www/vhosts/tudominio.com/httpdocs (host would be the ip of your machine , and / var / www / vhosts / tudominio.com / httpdocs copy the path where the compressed file)

-tar -xvf backup.tar.gz (whereby the contents of the file descomprimiríamos)