Tar to remote machine


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Tar to remote machine
# 1  
Old 08-02-2006
Tar to remote machine

Is there a way to use Tar (not GNU) to automaticallly create a tar file on a remote machine. the source files will be local, but I would like tthe tar file to be remote.

Thanks.
# 2  
Old 08-02-2006
tar doesn't support this directly, and neither would any sane archiver. Your question boils down to "how do I send files to another machine?"

A couple options:
  • tar the files, then ftp the tar file onto the other machine.
  • Mount a directory on the target machine onto your own using something like nfs or samba, then create the archive in that.
  • Stream the file over a network socket somehow, so that it never needs to exist locally. I built a hack to do this once, and don't reccomend it's use, but it shows how to use tar as a stream.
# 3  
Old 01-23-2009
$ tar --rsh-command=`which ssh` -zcvf remote_host:filename.tar.gz -- directory_to_tar

Single line solution, not a hack, part of tar. Works even if you don't have enough space to create the archive on the local machine. use -jcvf and filename.tar.bz2 if you want a little better compression. Data is sent securely over the wire, assuming you have SSH setup correctly.

man tar is your friend. Boosh!

Last edited by jvpiel; 01-23-2009 at 07:20 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with fetching the data from remote machine from my jumpbox(local machine)

Team, Presently i am running a script from my local box(i.e jumpbox) to all the remote machines.Basically fetching basic queries like pwd,mkdir,touch etc and i am able to successfully fetch it from my local machine.But when i want to check certain database related queries like the dbstat... (20 Replies)
Discussion started by: whizkidash
20 Replies

2. Red Hat

iptables applied in local machine, can't ssh remote machine after chain changed to DROP

I want to SSH to 192.168.1.15 Server from my machine, my ip was 192.168.1.99 Source Destination was UP, with IP 192.168.1.15. This is LAN Network there are 30 Machine's Connected to the network and working fine, I'm Playing around the local machine's because I need to apply the same rules in... (2 Replies)
Discussion started by: babinlonston
2 Replies

3. UNIX for Dummies Questions & Answers

Remote FTP Backup -Tar archive+ encrypt+ split to a remote ftp

I have a huge directoy(200+ gb) for backup. I want upload the tar file(split files) simultaneous to a remote ftp. (pipeline, stdout, stdin etc.) I don't want write a data to local hdd. I have a ssd hdd. thanks. this code doesn't work.( yes i know the problem is split command!) tar cvzf -... (8 Replies)
Discussion started by: tara123
8 Replies

4. UNIX for Advanced & Expert Users

FTP While transfering files to local machine to remote machine

Hi Am using unix Ksh Am getting the problem while transferring zero size files through the script . When i transfer zero size files from local machine to remote machine manually i can able to do it . My question its beause of zero size files am not able to transfer through script ? or its... (2 Replies)
Discussion started by: Venkatesh1
2 Replies

5. Infrastructure Monitoring

SNMP from remote machine

Hi, I have sucessfully set up snmp daemon on my AIX box (v 6.1.2.0). I can query snmp from localhost (using command: snmpinfo -v -m dump -c public mib-2) and it works perfectly. But I don't get any reply when query my AIX box from remote machine (AIX, Linux,...) I have tried to set up SNMP v1... (0 Replies)
Discussion started by: pavel.kovar
0 Replies

6. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

7. Shell Programming and Scripting

Need a script to tar all file systems on the machine into one filesystem.

Hi I am very poor at scripting.:o I need to develop a script that should tar up all the filesystems on the machine on to a single filesystem called /tarfilesystem. Any suggestions ... Thank You very much (1 Reply)
Discussion started by: urrahman_zia
1 Replies

8. UNIX for Advanced & Expert Users

Help regarding theMailing of output from a remote machine

Hi all, I have a script which logs in to the remote server with FTP and with the user id/password and list the files in the path of remote server where thefiles resid.i need to email this output(i.e wether the files are present on not under the path) to my email id. Can u please let me know as... (1 Reply)
Discussion started by: OSD
1 Replies

9. Shell Programming and Scripting

Creation and Transfer of TAR file from one machine to another Using UNIX script

Hi, I want to create unix script such that it should run on machine A, it should run TAR commands on machine B and copy that TAR to machine C. Is it possible? Thanks Rahul (2 Replies)
Discussion started by: rahuljadhav
2 Replies
Login or Register to Ask a Question