Looking at the script in post#1 I feel inclined to comment on a few points:
- Don't cd to and fro ( as already pointed out by greet_sed) but use absolut paths.
- Don't use temp files if not necessary.
- Don't use "command substitution" excessively - use available shell tools where appropriate, avoiding surplus process creation.
- Looks like you're removing the freshly created backup with rm -rf "$DATE_Ymd". Why?
Look into this little proposal; you might want to consider this or that hint in it:
Code:
while read V1 X IP X X TARGET X
do [ ! "$V1" = "IP" ] && continue
# test the IP if necessary
echo $IP, $TARGET
# further processing, like
HOSTNAME=$(ssh "$IP" 'hostname')
mkdir -p "$HOME_BACKUP"/"$HOSTNAME"/"$DATE_Ymd"
rsync -azvtP rsync_user@"$IP":"$TARGET" "$HOME_BACKUP"/"$HOSTNAME"/"$DATE_Ymd"
done < cfg_file
hi all
i have joined new to the group.
i have set an variable in my bashrc file.
.bashrc
PROGHOME=/home/braf/braf/prog
export PROGHOME
but while using it in my shell script its path is not taken and i had to explicitly give the export command to set the path.
in my script... (8 Replies)
How can i add a varying filename at the end of a constant file path?
Eg:
Variable containing file name is varfile (say varfile=newfile)
File path is C:\Test\
I want to access newfile which can be done as
C:/\Test/\newfile
But instead of directly accesing the newfile i want to access it... (2 Replies)
Hi everybody
I looking the put the result of a commane to a Variable
i explain
here is my command:
FJTS_UK:root:common@ukaix3:/> cat sortie | grep "^"| awk '{ print $1}'
15
FJTS_UK:root:common@ukaix3:/>
sortie is a texte file
I want to put the result of commande in a... (1 Reply)
I have a file that contains the following lines
the brown quick fox
jumped over
the white laze dog
0123456789
I wanted to put the contents of this file into a variable so I used this code:
VAR_LIST=`cat $2`
where $2 is the file name passed as an argument to the script
If I... (3 Replies)
For example, I have a simple text file
note:
this a note
a simple note
a very very simple notewhen I use this command,
temp=$(cat "note.txt")then I echo temp, the result is in one line.
echo $temp
note: this a note a simple note a very very simple noteMy variable doesn't have newline.
How... (7 Replies)
Hi i have need of read a file value with cat command and remove first 2character for example cat /sys/class/rtc/day
0x12
Remove char
12
And put this value in a variable
is possible with a script thanks for help (6 Replies)
I want to pattern match only path part from below and replace them with new path string.
LoadModule jk_module /fldrA/fldrBaf/fldrCaa/modules/mod_jk.so
JkWorkersFile /fldrA/fldrBaf/fldrCaa/config/OHS/ohs1/workers.properties
JkLogFile... (4 Replies)
i am having some bash script which must use first sentence of the file. For example i have file which content is:
test 213
So I must use word test into my bash script, and put it into variable.
I am using a one variable named value
value=$(</home/rusher/test.txt)
so instead using test.txt... (1 Reply)
Hello all,
I am EXTREMELY new to using bash and I have a bit of a problem: I'm trying to set up a shell script that can
1.) take one of several giant files off of an external hard drive
2.) use it as input for scripts on my laptop's hard drive
... (3 Replies)
Discussion started by: machine_spirit
3 Replies
LEARN ABOUT CENTOS
dtest1
dtest(1) USER COMMANDS dtest(1)NAME
dtest - simple uDAPL send/receive and RDMA test
SYNOPSIS
dtest [-P provider] [-b buf size] [-B burst count][-v] [-c] [-p] [-d] [-s]
dtest [-P provider] [-b buf size] [-B burst count][-v] [-c] [-p] [-d] [-h HOSTNAME]
DESCRIPTION
dtest is a simple test used to exercise and verify the uDAPL interfaces. At least two instantiations of the test must be run. One acts as
the server and the other the client. The server side of the test, once invoked listens for connection requests, until timing out or killed.
Upon receipt of a cd connection request, the connection is established, the server and client sides exchange information necessary to per-
form RDMA writes and reads.
OPTIONS -P=PROVIDER
use PROVIDER to specify uDAPL interface using /etc/dat.conf (default OpenIB-cma)
-b=BUFFER_SIZE
use buffer size BUFFER_SIZE for RDMA(default 64)
-B=BURST_COUNT
use busrt count BURST_COUNT for interations (default 10)
-v, verbose output(default off)
-c, use consumer notification events (default off)
-p, use polling (default wait for event)
-d, delay in seconds before close (default off)
-s, run as server (default - run as server)
-h=HOSTNAME
use HOSTNAME to specify server hostname or IP address (default - none)
EXAMPLES
dtest -P OpenIB-cma -v -s
Starts a server process with debug verbosity using provider OpenIB-cma.
dtest -P OpenIB-cma -h server1-ib0
Starts a client process, using OpenIB-cma provider to connect to hostname server1-ib0.
SEE ALSO dapltest(1)AUTHORS
Arlin Davis
<ardavis@ichips.intel.com>
BUGS uDAPL 1.2 February 23, 2007 dtest(1)