login about faq

Could you give an example of how SSH can be used in a script for backup on Solaris?

asked Dec 21 '10 at 18:56

SSH%20KB's gravatar image

SSH KB ♦
509249246237


Here is a simple Unix-to-Unix backup script. Note that you need to set up non-interactive authentication for this to work.

#!/bin/sh
# Server data is backed up locally, then transferred to remote 
# machine where the tape drive resides, then the transferred backup 
# file on remote is erased to save disk space. 

OUTPUT="/path/to/file"
TAPE="name_of_server_that_has_tape"
DRIVE="path/to/tape/drive"

/usr/sbin/ufsdump 0cuf - / - | dd of=$OUTPUT
scpg3 -B $OUTPUT $TAPE:$DRIVE
sshg3 $TAPE "dd if=$OUTPUT of=/path/to/tape && rm -f $OUTPUT"
link

answered Dec 21 '10 at 19:01

SSH%20KB's gravatar image

SSH KB ♦
509249246237

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×11
×5

Asked: Dec 21 '10 at 18:56

Seen: 5,763 times

Last updated: Mar 01 '11 at 22:22

All user contributed content licensed under the cc-by-sa license.
Powered by OSQA.