The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Scripting question moe2266 Shell Programming and Scripting 1 08-02-2007 01:21 AM
scripting question carlvernon Shell Programming and Scripting 10 04-21-2006 06:42 AM
scripting question batmike Shell Programming and Scripting 3 11-26-2002 04:58 PM
Scripting Question damielle Shell Programming and Scripting 1 12-06-2001 05:13 PM
another scripting question kristy UNIX for Dummies Questions & Answers 1 05-07-2001 12:02 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-18-2006
justinburbridge justinburbridge is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 5
scripting question?

I am writing a backup script for AIX 5 and running into a problem where the output isn't being shown in the output log that is being created. Any ideas on how this would be corrected? I have included the script below. The only thing showing up in the file is listed below. I was hoping to capture all the stages of the output from the backup command that is actually seen when you run it from the command line.

--current output --cut and paste ---
Hello this is dumper_0 on 041706 on peter
We'll be performing backups this morning, for:





dumper_0 completed at 041706

--current output -- end of cut and paste ----


-- actual script -- cut and paste ----

#!/bin/csh -f
#
# $Source$
# $Revision$
# $Date$
# dumper_0
#
# Configured to backup local file systems on aixdbart01

set date = `date +%m%d%y`
set name = dumper_0
set host = peter
#
#
#
#
#
#set alarm1 = Cell or pager info
#set alarm2 =
set admin =
set file = /home/backuplogs/$host.$date
set header = /var/backups/header/$host.backup

#
#
#


touch $file

cp $header $file
echo "Hello this is $name on $date on $host" >> $file
echo "We'll be performing backups this morning, for:" >>
$file
echo "" >> $file
echo "" >> $file
echo "" >> $file

tctl -f /dev/rmt0 rewind

#################################################

backup -0 -u -f /dev/rmt0 / >> $file
#backup -0 -u -f /dev/rmt0 /usr >> $file
#backup -0 -u -f /dev/rmt0 /var >> $file
#backup -0 -u -f /dev/rmt0 /home >> $file
#backup -0 -u -f /dev/rmt0 /opt >> $file
#backup -0 -u -f /dev/rmt0 /home/app >> $file
#backup -0 -u -f /dev/rmt0 /u01 >> $file
#backup -0 -u -f /dev/rmt0 /u02 >> $file
#backup -0 -u -f /dev/rmt0 /sortmerge >> $file
#backup -0 -u -f /dev/rmt0 /proj >> $file


#################################################

echo "" >> $file
echo "" >> $file

echo "$name completed at $date" >> $file


/usr/bin/mail -s Backup for peter $admin < $file

-- actual script -- end cut and paste ----
  #2 (permalink)  
Old 04-19-2006
ginoe ginoe is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 5
Hello

you can use this command in your script :

backup -0 -u -f /dev/rmt0 / >> $file 2>&1

and all output of the backup command will be redirected to you log file.

Please try
  #3 (permalink)  
Old 04-19-2006
justinburbridge justinburbridge is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 5
Thanks ginoe, that did the trick.

Thanks ginoe, that did the trick.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0