02-02-2015
Quote:
Originally Posted by
RudiC
I don't see the necessity to use a variable if you run an ssh command. From what you showed in post #1, there is an entire directory listing to be processed, and you did not specify the output format desired.
Please provide the entire picture of what you need to do so we can provide a fit solution.
Ok. let me explain what exactly i want.
I'm using zenoss to monitor my servers. in the zenoss i cant handle the plain text. i just can use the numerical values. now i want create an alert to warn me if there was no back up files.
so i decided to wrote an script to do this.
now if you guys have better idea please share it with me.
i really appreciate any sort of help.
thank you.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Is it possible to redirect the output from 'tar xvf' to another directory?
The taped tar image is extracting to my / dircetory - even though i'm running the command from /backups.
The contents list of the tape shows files created from /livebackups/...
Thanks
Richard (7 Replies)
Discussion started by: colesy
7 Replies
2. UNIX for Advanced & Expert Users
anyone know if it is possable to extract a subdirectory in a tar file.
IE
tarfile contains
parent dir
-sub dir A
-sub dir B
I want to extract sub dir B. (2 Replies)
Discussion started by: Optimus_P
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I would like to extract the files from an archive which I have copied from a different server which has different file structures to my server.
When I do a tar xvf archive_name, I get the error saying the file or directory cannot be found. How do I specify a desginated directory to... (4 Replies)
Discussion started by: john_trinh
4 Replies
4. UNIX for Advanced & Expert Users
Hi,
I created a tar file of a directory dir1 from /tmp in the following way
$pwd
/tmp
$tar -cvf dir1.tar dir1 (dir1 will have say file1)
Now i want to extract it in the directory /tmp/dir2 so that the directory dir1 is also created and extracted... (1 Reply)
Discussion started by: ammu
1 Replies
5. Shell Programming and Scripting
Im trying to extract a directory from a path entered by the user
Lets say the path is
path=/home/bliss/files/myfile.txt
i wanna extract "/home/bliss/files" from $path ... how can i do this? (4 Replies)
Discussion started by: mrudula009
4 Replies
6. UNIX for Dummies Questions & Answers
I am trying to loop through folders and extract the name of the lowest level subfolder
I was running the script below, it returns
/bb/bin/prd/newyork
/bb/bin/prd/london
/bb/bin/prd/tokyo
I really want
newyork
london
tokyo
I couldn't find a standard variable for the lowest level... (1 Reply)
Discussion started by: personalt
1 Replies
7. UNIX for Dummies Questions & Answers
I think I know what this is doing, but the 'eval' is confusing
fname=$(echo ${lineItem} | awk 'BEGIN {FS=";"}{print $1}')
fname=${fname%%+(])}
fname=${fname##+(])}
eval "fname=${fname}"
The first line extracts the contents of the line preceeding the ";"
2nd & 3rd lines trim the value (I... (5 Replies)
Discussion started by: jdorn001
5 Replies
8. UNIX for Dummies Questions & Answers
My input is as below :
/splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt
/splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt
/splunk/scrubbed/loyal/IFIND.HELLO.WROC.txt
/splunk/scrubbed/triumph/ifind.triumph.txt
From the above input I want to extract the file names only .
Basically I want to... (5 Replies)
Discussion started by: IshuGupta
5 Replies
9. Shell Programming and Scripting
Trying to download and extract a file to a specific folder, but getting an error. What am I doing wrong? Is there a way to rename the download if desired? Thank you :).
curl --url https://github.com/arq5x/bedtools2/releases/download/v2.26.0/bedtools-2.26.0.tar.gz | tar -xz --output... (4 Replies)
Discussion started by: cmccabe
4 Replies
10. UNIX for Beginners Questions & Answers
i was attempting to extract a directory path that was passed from a parameter with this code
vdir=`dirname $p1`
echo current directory $vdir
it does not work when the parameter passed has wild card on it.
for example
$ sh sample1.sh "/sbin/log/c*.log"
dirname: extra operand... (2 Replies)
Discussion started by: wtolentino
2 Replies
LEARN ABOUT CENTOS
db2bak
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)