tar/untar over ssh

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat tar/untar over ssh
# 1  
Old 09-08-2011
tar/untar over ssh

I use red hat linux.
I have two linux server .
I want to use tar over ssh to tar and untar the file.
The server A , have IP 10.1.1.a ,there is dir a and contain files.
The server B have IP 10.1.1.b , there is dir b and contain file .
So, in above case ,how can I tar over ssh sunc that the file in dir a , server a can tar to server b ,dir b .
and if I use untar over ssh ,if the tar ball in server b , dir b ,say b.tar , how can I extract it to server a ,dir a over ssh ???
Please advice in detailed command .

Last edited by zaxxon; 09-08-2011 at 02:26 AM.. Reason: Removed small font settings (2), I already have glasses ;)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Untar only folder structure from a tar ball

I have a tar file hello.tar which is 95 GB. hello.tar has many files and folders including some tar files as well. I wish to create a new tar ball which should maintain only the folder structure of hello.tar and the tar ball within the hello.tar So basically the idea is to untar... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. UNIX for Dummies Questions & Answers

How to Untar tar.gz to particular directory

Hi Guys, I am able to untar a tar.gz file. But it is again extracting the tar file to further child directory. I even tried the below command to untar it to particular directory. tar -zxvf gme_dly_sls_20120515035335.txt.tar.gz -C /sites/VSTAR/site/live/ftp/GMEUROPE I am getting the below... (4 Replies)
Discussion started by: mac4rfree
4 Replies

3. Shell Programming and Scripting

scp/untar .tar file in parallel issue

Hi Guys, I am facing a strange issue while doing parallel (using & for background) scp/untar operation from my unix box to multiple unix boxes... I am getting tar : unexpected EOF in archive error the code is as follows.,,, for i in 10 do sh -c "scp <command> ; ssh tar -xf <tar> -C... (4 Replies)
Discussion started by: mihirvora16
4 Replies

4. UNIX for Advanced & Expert Users

tar and untar the files using single line

Hi, i want tar the files from one location and untar it to other location using single line. Can any one help me zip and unzip using single line command. (2 Replies)
Discussion started by: venikathir
2 Replies

5. UNIX for Dummies Questions & Answers

untar a tar file

how can I untar a file without extracting it? sample: file.tar to file thanks, lara (1 Reply)
Discussion started by: lhareigh890
1 Replies

6. UNIX for Dummies Questions & Answers

tar and untar commands

I have a script to ftp, archive and delete files. I used tar command to archive files from a list and then all files were removed from name1/name2/name2/. find /name1/name2/name2/ -name "*.txt" -print > filelist.log while read line do if ; then tar cvf $tarfile $line else ... (3 Replies)
Discussion started by: Lenora2009
3 Replies

7. Shell Programming and Scripting

Script to untar latest tar file

I am trying to put together a script that will check for the latest file in a directory then extract it. The extraction and the scheduling I can do, but am not sure how to get it to check for the latest file. These files are uploaded every evening by an external party and the previous days files... (3 Replies)
Discussion started by: stheologo
3 Replies

8. UNIX for Advanced & Expert Users

Tar utility (untar a .tar file) on VxWorks

Hi All Can someone pls guide me if there any utility to compress file on windows & uncompress on vxworks I tried as - - compressed some folders on windows ... i created .tar ( to maintain directory structure ) and compressed to .gz format. - on VxWorks i have uncompressed it to .tar... (1 Reply)
Discussion started by: uday_01
1 Replies

9. UNIX for Dummies Questions & Answers

Untar a TAR file at different location

Hi, I want to UNTAR a TAR file at different location. Is it possible? My TAR file contains the files with absolute path. Malay (5 Replies)
Discussion started by: malaymaru
5 Replies

10. UNIX for Advanced & Expert Users

gnu tar applying user:group to untar

When I, or any other user, tar -xzvf file.tar.gz the resulting uncompressed directory/file has the owner:group of a user on my system, but not that of the user who untared it. How can this be? Is there a .conf file for gnutar that I'm not aware of? Details: --> running RedHat 7.1 --> 45... (4 Replies)
Discussion started by: vancouver_joe
4 Replies
Login or Register to Ask a Question
tar(n)								 Tar file handling							    tar(n)

__________________________________________________________________________________________________________________________________________________

NAME
tar - Tar file creation, extraction & manipulation SYNOPSIS
package require Tcl 8.4 package require tar ?0.6? ::tar::contents tarball ::tar::stat tarball ?file? ::tar::untar tarball args ::tar::get tarball fileName ::tar::create tarball files args ::tar::add tarball files args ::tar::remove tarball files _________________________________________________________________ DESCRIPTION
::tar::contents tarball Returns a list of the files contained in tarball. The order is not sorted and depends on the order files were stored in the archive. ::tar::stat tarball ?file? Returns a nested dict containing information on the named ?file? in tarball, or all files if none is specified. The top level are pairs of filename and info. The info is a dict with the keys "mode uid gid size mtime type linkname uname gname devmajor devminor % ::tar::stat tarball.tar foo.jpg {mode 0644 uid 1000 gid 0 size 7580 mtime 811903867 type file linkname {} uname user gname wheel devmajor 0 devminor 0} ::tar::untar tarball args Extracts tarball. -file and -glob limit the extraction to files which exactly match or pattern match the given argument. No error is thrown if no files match. Returns a list of filenames extracted and the file size. The size will be null for non regular files. Leading path seperators are stripped so paths will always be relative. -dir dirName Directory to extract to. Uses pwd if none is specified -file fileName Only extract the file with this name. The name is matched against the complete path stored in the archive including directo- ries. -glob pattern Only extract files patching this glob style pattern. The pattern is matched against the complete path stored in the archive. -nooverwrite Dont overwrite files that already exist -nomtime Leave the file modification time as the current time instead of setting it to the value in the archive. -noperms In Unix, leave the file permissions as the current umask instead of setting them to the values in the archive. % foreach {file size} [::tar::untar tarball.tar -glob *.jpg] { puts "Extracted $file ($size bytes)" } ::tar::get tarball fileName Returns the contents of fileName from the tarball % set readme [::tar::get tarball.tar doc/README] { % puts $readme } ::tar::create tarball files args Creates a new tar file containing the files. files must be specified as a single argument which is a proper list of filenames. -dereference Normally create will store links as an actual link pointing at a file that may or may not exist in the archive. Specifying this option will cause the actual file point to by the link to be stored instead. % ::tar::create new.tar [glob -nocomplain file*] % ::tar::contents new.tar file1 file2 file3 ::tar::add tarball files args Appends files to the end of the existing tarball. files must be specified as a single argument which is a proper list of filenames. -dereference Normally add will store links as an actual link pointing at a file that may or may not exist in the archive. Specifying this option will cause the actual file point to by the link to be stored instead. -prefix string Normally add will store files under exactly the name specified as argument. Specifying a ?-prefix? causes the string to be prepended to every name. -quick The only sure way to find the position in the tarball where new files can be added is to read it from start, but if tarball was written with a "blocksize" of 1 (as this package does) then one can alternatively find this position by seeking from the end. The ?-quick? option tells add to do the latter. ::tar::remove tarball files Removes files from the tarball. No error will result if the file does not exist in the tarball. Directory write permission and free disk space equivalent to at least the size of the tarball will be needed. % ::tar::remove new.tar {file2 file3} % ::tar::contents new.tar file3 BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category tar of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
archive, tape archive, tar CATEGORY
File formats tar 0.6 tar(n)