Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Use tar Command Through Network Over SSH Session  (Read 6004 times)

0 Members and 1 Guest are viewing this topic.

rohitj

  • Guest
Use tar Command Through Network Over SSH Session
« on: October 26, 2013, 12:20:53 pm »
Use tar Command Through Network Over SSH Session


In order to increase the transferring speed and time consuming, We can use tar command over SSH in order to transfer data from one server to another instead of SCP.As the files will be in a compressed format, the data transferring will complete faster than SCP.

In order to transfer a folder, please execute the below command.

===============
tar zcvf - wordpress | ssh root@192.168.*.* "cat > /home/word.tar.gz"
===============


For example:

============
tar zcvf - wordpress | ssh root@192.168.*.* "cat > /home/word.tar.gz"
wordpress/wp-admin/user-edit.php                                                                                                                                                               
wordpress/wp-admin/network.php 
......
...
.
Password:
===========

After that you can restore the data by login to the destination server use "tar -zxvf filname.tar.gz" or you can restore it via SSH too.

=========
ssh root@192.168.*.* "cat /home/word.tar.gz" | tar zxvf -
=========

 ;)