iacros.blogg.se

Tar compress and ssh to remote folder
Tar compress and ssh to remote folder













With that dump you are sure, that you did not miss any important metadata (like ACLs) which tar won't capture. path ssh server2 'cat > /' Any string that follows your 'ssh' command will be run on the remote server instead of the interactive logon. Do that with other partitions on the failing drive, too. Instead of using tar to write to your local disk, you can write directly to the remote server over the network using ssh. Where you had to adopt /dev/sda1 to the right device. However, you should (also) consider to make a dd dump of the failing drive's partitions: cd good_partition netcat -l -p 1234 > dd if=/dev/sda1 | netcat good_host.ip 1234 (especially the file representing your RAM in ( /proc/kcore) will add an unnecessary amount of data). I included some -exclude parameters, as /proc and /sys are virtual filesystems and hence useless on the new host. The bad host sends the data to this port, also using tar and netcat. Which opens a listening port 1234 on the good machine netcat -l -p 1234 and pipes the incoming data to tar to extract (preserving mtime and permissions). If you change a services Dockerfile or the contents of its build directory, run docker compose build to rebuild it.

tar compress and ssh to remote folder

It is working fine, and the folders structure is replicated as the same in my local drive. cd good_partition netcat -l -p 1234 | tar xvpmf tar -cv -f-exclude=/proc -exclude=/sys / | netcat good_host.ip 1234 0 I am using the command ssh userremote -p 22 'tar cz my-folder' tar xz -C /d/local-backups to backup distant folders to my local drive. The remote server should have a ssh-server (called sshd) running to connect to the remote machine.

tar compress and ssh to remote folder tar compress and ssh to remote folder

This is usually much faster as it doesn't encrypt the data. Requirements Both system must support ssh and have tar and gzip installed. If both computers are on the same (safe) LAN, I recommend a different approach using netcat.















Tar compress and ssh to remote folder