ufsdump to a remote server


 
Thread Tools Search this Thread
Operating Systems Solaris ufsdump to a remote server
# 1  
Old 03-18-2009
ufsdump to a remote server

Hello,

how can I use ufsdump utility for filesystem backup to a remote directory on a server dedicated for backups ( over network) ??
# 2  
Old 03-18-2009
If you have a server dedicated for backups over the network, then you apparently have several other servers that need backing up? Why not just adopt Amanda? Amanda Open Source Backup. There is a wrapper I posted on the Zmanda wiki that does fssnap snapshots with ufsdump for Solaris. Backup client - The Open Source Backup Wiki (Amanda, MySQL Backup, BackupPC).

If you just want to try to do it yourself, the examples on docs.sun.com (in the System Administrators Collection for Solaris) depend on rsh and .rhosts. Those are generally regarded as not being secure. I would do it through an ssh pipe. I have a rather extensive script that does the same fssnap snapshot with ufsdump and can do it to a remote drive over ssh. I recently posted it so that people could look at it for reference. Minimalist SysAdmin Tape backup script for Solaris 9 or 10. You're welcome to look at it for reference and/or use it directly. However, it sounds like your situation may be better served by using Amanda.
# 3  
Old 03-18-2009
You can use rsh or ssh. For example:
ssh remote_server ufsdump /path/to/fs
# 4  
Old 03-19-2009
Quote:
Originally Posted by incredible
You can use rsh or ssh. For example:
ssh remote_server ufsdump /path/to/fs
syntax and conceptualization of that is all wrong.

If you want to ssh to the remote server and then execute something there, then you need quotes around the "something." e.g.

ssh remote_server "ufsdump /path/to/fs"

But, the OP wants to run ufsdump and send that output to the remote_server to be stored there. Presumably, he wants to automate that. Also, ufsdump has other options that need to be dealt with. So, things get noticeably more complicated.

ufsdump needs to be run as root. You want automatic login with ssh certs, but you don't want to do that as root. So, set up a backup user, and setup ssh certs for the backup user (see OpenSSH Public Key Authentication for guidance.) Then run some variation of the following, adapted to your system and needs:

Code:

( /usr/lib/fs/ufs/ufsdump ${LEVEL}cnlTfuN 2h - ${RDEV} ${WHICHSNAP}; \
  STATCODE=$?; echo ${STATCODE} > ${CODEFILE} ) \
  | su - backup -c "ssh ${TAPESERVER} \"dd obs=64b of=${TAPDEV}\"";
STATCODE=`cat ${CODEFILE}`;

That generates the data stream from ufsdump, pipes it through ssh, and uses dd on the opposite end to put it to a tape drive. It happens to be embedded in a larger script, and is using an fssnap snapshot to do the dump. It also captures the return status of the ufsdump so that a script can take action based on the success or failure, or at least report it. That introduced a bit of complication, because that has to be paired with the ufsdump as a subprocess, and you can't pass environment variables back out from a subprocess -- thus, the code file to get the status code back out.

Anyway, I've already given the reference/link to the full script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

3. Solaris

Server migration - using ufsdump

hi all, i am refreshing my hardware, but i do not want to do a clean installation/reinstallation. I am wondering if i could do - do a ufsdump of the / partition (into a file on a nfs share) - bootup using cdrom in the new machine - mount the boot device/slice, and restore the ufsdump on... (7 Replies)
Discussion started by: javanoob
7 Replies

4. Solaris

Restore a server from a ufsdump

Hi guys i tried to restore a server from a ufsdump. For your information, the ufsdump was created on a v440 and i have to restore it to a v240... is it supported? should it work? don't know but i try! the problem is after restoring the filesystem, modify the vfstab, system file and install... (5 Replies)
Discussion started by: beta17
5 Replies

5. Solaris

identify server type from ufsdump

Hi guys I have a little problem. I need to identify the server type from some ufsdumps. How can i do that? I grepped with: grep Sun messages* but with this command, if there server was never rebooted, i cannot recognize the server type. any other idea? thx in advance Ivan (5 Replies)
Discussion started by: beta17
5 Replies

6. UNIX for Dummies Questions & Answers

How to do a ufsdump remote?

People i have 2 sun sparc solaris 10. I have one filesystem to 98% and i need to do a ufsdump of that filesystem. THe problem is that i don't have space to allocate the dump of the filesystem. Thats why i want to do it from the other sun and bring the ufs dump to de /FREE filesystem. ... (4 Replies)
Discussion started by: enkei17
4 Replies

7. Solaris

Making backup with ufsdump to remote mounted filesystems

Hi Unix members. I am trying to make a backup to remote mounted filesystems : fileraseing:/vol/oracliente_revap01 10G 1.3G 8.7G 13% /orarev_ap01 fileraseing:/vol/bobje 10G 5.9G 4.1G 60% /bobje But I am receiving the follow message when use the ufsdump command: :$PWD>ufsdump 0fu... (8 Replies)
Discussion started by: aggadtech08
8 Replies

8. UNIX for Advanced & Expert Users

Building New server using ufsdump/ufsrestore

Hi Guys, Marry X-MAX in advance :) I would like to build a new server using ufsdump/ufsrestore. Both the servers are identical hardware and model. I am using Solaris 10 X86 O/S. I am having ufsdump "mydump.rootdump.gz" in a Central NFS server. What I did:- I took backup of root... (1 Reply)
Discussion started by: SanjayLinux
1 Replies

9. Filesystems, Disks and Memory

Building New server using Ufsdump/ufsrestore

Hi Guys, Marry X-MAX in advance :) I would like to build a new server using ufsdump/ufsrestore. Both the servers are identical hardware and model. I am using Solaris 10 X86 O/S. I am having ufsdump "mydump.rootdump.gz" in a Central NFS server. What I did:- I took backup of root... (1 Reply)
Discussion started by: SanjayLinux
1 Replies

10. UNIX for Advanced & Expert Users

remote ufsdump permissions

Hi, I have two solaris 9 boxes: SunOS bmsapp01 5.9 Generic_118558-06 sun4u sparc SUNW,Sun-Fire-V440 and SunOS bmsdb01 5.9 Generic_118558-06 sun4u sparc SUNW,Sun-Fire-V440. The bmsapp01 server has a SDLT tape drive attached to it. I am trying to perform a remote ufsdump to the tape drive on... (5 Replies)
Discussion started by: jabberwocky
5 Replies
Login or Register to Ask a Question