Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

linux tar command for remote machine

How can I create a .tar archive of a file (say /root/bugzilla) on a remote machine and store it on a local machine. SSH-KEYGEN is installed, so I can by pass authentication.

I am looking for something along the lines of:

tar -zcvf Localmachine_bugzilla.tar.gz /root/bugzilla
like image 527
Rajeev Avatar asked Dec 01 '25 01:12

Rajeev


1 Answers

ssh <host> tar -zcvf - /root/bugzilla > bugzilla.tar.gz

avoids an intermediary copy.

See also this post for a couple of variants: Remote Linux server to remote linux server dir copy. How?

like image 119
Peter G. Avatar answered Dec 02 '25 14:12

Peter G.