Sponsored Content
Top Forums UNIX for Dummies Questions & Answers set uid question w/ backup script Post 5336 by Optimus_P on Friday 10th of August 2001 04:28:26 PM
Old 08-10-2001
set uid question w/ backup script

this is the backup script. When i run it as a non root or authority user i get the following errors for each filesystem being backedup. It then continues to the next fs. Do i have this set up correctly? am i missing something?

backup: The backup command has ended abnormally.
backup: 0511-225 Cannot open /dev/rmt0.1.
Operation not permitted.

Code:
#! /bin/ksh
#
#       This script is intended to be used on AIX 4.3.3 and 4.3.2 ONLY.
#       This will use the backup utility doing a level 0 dump on any filesystem defined for $filesys and update /etc/dumpdates.
#       Arguments:
#               DEVICE = backup device rmt0 = rewinding rmt0.1 = non-rewinding
#               DUMPINFO = file that will collect info to be emailed out
#               MARK = possition on the tape
#

DEVICE="/dev/rmt0.1"
DUMPINFO=/tmp/dumpinfo
FILESYSTEMS="/ /usr /var /home"
MARK=1

echo > $DUMPINFO

for filesys in $FILESYSTEMS; do
        echo "Date: `date`
Filesystem: $filesys
Position: $MARK
Device: $DEVICE
        " >> $DUMPINFO
        /usr/sbin/backup -f $DEVICE -0 -u $filesys >/dev/null 2>&1
        MARK=`expr ${MARK} + 1`
done
cat $DUMPINFO|mailx -s "Dumpinfo `hostname`" root
sleep 20
mt -f $DEVICE rewoffl

Script Perms:
-r-sr-sr-x 1 root system 850 Aug 09 17:11 /var/adm/scripts/backup.ksh

Backup command perms (just incase needed):
-r-xr-xr-x 1 root system 4320 Dec 24 1998 /usr/sbin/backup


Last edited by Optimus_P; 08-10-2001 at 07:58 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

set UID on linux

Hi, I just want to know if it's possible to set the UID bit for a script, so that it executes not as a owner of process, but owner of the script. i.e script tesh.sh owned by 'user1', 'file1' owned by user1 has 700 permisssions `who am i` rm -v /tmp/file1 user 2 need to execute test.sh, ... (2 Replies)
Discussion started by: braindrain
2 Replies

2. AIX

Backup question

Hi All! I'm rather new in AIX so I want some comments about backup scheme I've developed to backup every part of the system. I have the following hardware: - Power6 570 server with two VIO server and 3 LPARs - NIM server outside (on the other Power server) - Windows 2003 Server with Tivoli... (2 Replies)
Discussion started by: kogor
2 Replies

3. Solaris

A question about backup.

Hi all. There are some SPARC mashines. What method can be made from them backup (slices or entire disk) in field conditions if I have only the laptop with win xp pro and the internet? (5 Replies)
Discussion started by: wolfgang
5 Replies

4. Shell Programming and Scripting

awk script doubt in extracting and comparing uid

Hi, I need to get the value of 'uid' from a line in file f1. For example, in the line below, I need to get the value '150', from the 'anonuid=150' key, and I need to verify that this is a valid uid by checking it against /etc/passwd (i.e) I want to compare this uid, 150 (or more if there are any... (2 Replies)
Discussion started by: royalibrahim
2 Replies

5. Shell Programming and Scripting

uid script help

i need a script to process a password file and based on the UIDs in the password file, generate the new UID that is 1 greater than the highest uid. i have some script logic but i dont really understand it. any help? #!/usr/bin/perl ########################################## #... (3 Replies)
Discussion started by: livewire06
3 Replies

6. Shell Programming and Scripting

Help with Backup Shell Script for Network Device Configuration backup

HI all, im new to shell scripting. need your guidence for my script. i wrote one script and is attached here Im explaining the requirement of script. AIM: Shell script to run automatically as per scheduled and backup few network devices configurations. Script will contain a set of commands... (4 Replies)
Discussion started by: saichand1985
4 Replies

7. Shell Programming and Scripting

Create user if UID not exist; else, exit the script

Hi, I want to write a script to check whether an user ID is used in my server and then create that user. If the user ID is not used, I will echo something like "OK, continue" and then continue to execute the script. Else, I will echo something like "Used, exit" and then exit the script. As... (4 Replies)
Discussion started by: dirkaulo
4 Replies

8. Shell Programming and Scripting

Script to pull uid greater than 1000 from remote server

Hello, I am trying to get UID # greater than 1000 from all linux server, I tried this script getting this error message, someone please suggest. $for i in `cat hostlist.0709.org` ; do ssh -t $i 'awk -F':' "{ if($3 >= 1000) print $0 }" /etc/passwd ' >> output ; done $ cat output hostname1... (4 Replies)
Discussion started by: bobby320
4 Replies

9. Shell Programming and Scripting

Help needed with shell script to search and replace a set of strings among the set of files

Hi, I am looking for a shell script which serves the below purpose. Please find below the algorithm for the same and any help on this would be highly appreciated. 1)set of strings need to be replaced among set of files(directory may contain different types of files) 2)It should search for... (10 Replies)
Discussion started by: Amulya
10 Replies
DB2BAK(8)						      System Manager's Manual							 DB2BAK(8)

NAME
db2bak - Directory Server script for making a backup of the database SYNOPSIS
db2bak [archivedir] [-Z serverID] [-q] [-h] DESCRIPTION
Creates a backup of the database. This script can be executed while the server is running or stopped. OPTIONS
A summary of options is included below: archivedir The full path to the directory to store the backup. -Z Server Identifier The server ID of the Directory Server instance. If there is only one instance on the system, this option can be skipped. -q Quiet mode. Reduces output of task. -h Display the usage. EXAMPLE
db2bak -Z instance2 Makes a backup of the entire database for 'instance2', and stores it in the default server instance backup directory. db2bak /LDAP/backups/20130305 Creates a backup of the database and stores it in specified location. DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a non-zero exit status and a diagnostic message being written to standard error. AUTHOR
db2bak was written by the 389 Project. REPORTING BUGS
Report bugs to http://bugzilla.redhat.com. COPYRIGHT
Copyright (C) 2013 Red Hat, Inc. Mar 5, 2013 DB2BAK(8)
All times are GMT -4. The time now is 09:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy