Making tar of a remote file system


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Making tar of a remote file system
# 1  
Old 10-21-2009
Making tar of a remote file system

Hello,

I was asked by my boss to make a backup of one of our systems that is slated to be decommissioned. When I suggested if could tar the "/" directory he nodded and said that would do the trick,

When I try and execute the command I get EOF error. I think it is because there is not enough space on the drive.

I am thinking of making a remote telnet session to the machine and having the backup stored on another machine...my deskop, which is where I will send the telnet command.

Anyone know the syntax for this?
# 2  
Old 10-22-2009
If you try and backup all filesystems to a tarball on the local machine, you'll go into a loop (backup up the backup file).

To do this via a telnet session is a bit tricky as (I think) telnet isn't really designed for non-interactive stuff.

I recommend ssh (or rsh if you have to):
Code:
server.to.backup# tar -cf - / | gzip -c | ssh -l <username> <destination.server> "cat > /where/you/want/to/store/your/backupfile.tar.gz"

Or
Code:
server.to.backup# tar -cf - / | gzip -c | ssh -l <username> <destination.server> (cat > /where/you/want/to/store/your/backupfile.tar.gz)

(Which command to use depends on your shell, if one fails, use the other)

You can leave out the gzip bit if you wish, that's just there to reduce the size it takes up.

You could also look into using ufsdump instead of tar but that's really a matter of preference.

If you can't use ssh, you should be able to just swap the word "ssh" in the above command for "rsh" (I've used ssh's backwards compatibility flags for that reason).
# 3  
Old 10-22-2009
Supplement to Smiling Dragons post: you can take some load off the server you're backing up by running the compression part on your local machine, eg (using the first command line given as reference):
Code:
tar -cf - / | ssh -l <username> <destination.server> "gzip -9c > /where/you/want/to/store/your/backupfile.tar.gz"

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Tar - pre-checking before making the Tar file

Coming from this thread, just wondering if there is an option to check if the Tar of the files/directory will be without any file-errors without actually making the tar. Scenario: Let's say you have a directory of 20GB, but you don't have the space to make Tar file at the moment, and you want... (14 Replies)
Discussion started by: filosophizer
14 Replies

2. AIX

Making Tar of directory and tar file is going to be placed

Quick question, is it possible to make a Tar of completely directory and placing the tar file in it (will this cause even the tar file to tarred ?) sample: /opt/freeware/bin/tar -cvf - /oracle | gzip > /oracle/backup.tgz will the tar file backup.tgz also include backup.tgz ? i tried... (5 Replies)
Discussion started by: filosophizer
5 Replies

3. UNIX for Advanced & Expert Users

Move files while making a tar

I have the following folder structure code/f1/ code/lib/t1 code/lib/t2 code/lib/t3 code/lib/t3 code/lib_1/t1 code/exc I would like to create a tar with a folder structure below and I can use the following tar command f1 lib/t1 lib/t2 lib/t3 tar -cvf code.tar -C code f1 lib... (4 Replies)
Discussion started by: alpboys
4 Replies

4. Solaris

how to restore an entire system from a tar file?

Hi folks, I have an image backup of an entire file system (Solaris 9 on N240) on a tar file. How can I use this tar file to retore my system? Thanks, omd (1 Reply)
Discussion started by: omd
1 Replies

5. UNIX for Dummies Questions & Answers

Facts about mounting remote file system

Say, we are going to mount a remote file system on our server. I am not too sure about how will data be transferred back to original host when it is written to the mounted FS. Could you please share an article or your knowledge on this? Thanks in advance; Stephen W. (2 Replies)
Discussion started by: swmk
2 Replies

6. UNIX for Advanced & Expert Users

Commands to copy a tar.gz file from a Remote Unix Server to Local Desktop.

Hi, Just wanted to know, how can I ftp/transfer/copy a (design.tar.gz) archive from a Unix Server (sdmc222.sdmc.cp-srv.com) which is at a remote location, to my Windows Desktop. Obviously, it is not possible at cmd prompt on my Windows using the following commands :- ftp... (3 Replies)
Discussion started by: marconi
3 Replies

7. Solaris

Mount a remote file system

Hello, I'm having troubles with sharing a filesystem across 2 machines... Machine A, running Solaris 10, is sharian via NFS the filesystem /sp. Machine B, running Solaris 10, is mounting /sp shared by A in /tm/sp and shares via NFS the /tm folder. Machine C, running HP-UX, is mounting... (4 Replies)
Discussion started by: mirciulicai
4 Replies

8. UNIX for Dummies Questions & Answers

File System - Remote or Local??

Is there a way to find if the file systems mounted on a AIX/Linux box is local or remote? (1 Reply)
Discussion started by: Un1xNewb1e
1 Replies

9. UNIX for Dummies Questions & Answers

how to mount a file system of a remote machine to local file system

Hi friends, In my case, there are serveral PCs running Linux in a LAN. I would like to to mount the directory /A_river of machine-A to the file system of another machine machine-B so that I can access files in that directory. I do not know how to do this. The situation is complicated by... (2 Replies)
Discussion started by: cy163
2 Replies

10. Shell Programming and Scripting

check if file exists on remote system ?

Hi there, I am designing a software rollout script and need to check if a particular file exists on a remote system something along the lines of if ; then blah blah The above doesnt work but you get the general idea....is there a way I can do this on a single line ?? any help would... (2 Replies)
Discussion started by: hcclnoodles
2 Replies
Login or Register to Ask a Question