Skip to Main Content
Linux System Administration
book

Linux System Administration

by Tom Adelstein, Bill Lubanovic
March 2007
Intermediate to advanced content levelIntermediate to advanced
304 pages
11h 12m
English
O'Reilly Media, Inc.
Content preview from Linux System Administration
266
|
Appendix: bash Script Samples
r="${r}/${b}"
announce="${d}/${f}"
rsyncopt="-a${checksum}${dryrun}${sparse}vz"
configout "${d}/." "file:${d}/${f}" >"${conffile}"
elif [[ -L "${name}" ]]; then
p=$( exec dirname "${name}" )
b=$( exec basename "${name}" )
d="${p}"
f="${b}"
r=$( cd "${p}" && exec pwd )
r="${r}/${b}"
announce="${d}/${f}"
rsyncopt="-a${checksum}v"
configout "${d}/." "symlink:${d}/${f}" "${f}" >"${conffile}"
fi
#----------------------------------------------------------------
# Show config file if verbose is requested.
#----------------------------------------------------------------
if [[ -n "${verbose}" ]]; then
echo "${bar2}"
ls -ld "${conffile}"
echo "${bar2}"
cat "${conffile}"
fi
#----------------------------------------------------------------
# This function outputs example receive commands.
#----------------------------------------------------------------
function showrsync {
echo -n "rsync ${rsyncopt} "
if [[ -n "${oldfmt}" ]]; then
echo "--port=${port}" $( strquote "${1}::${2}" ) $( strquote "${3}" )
else
echo $( strquote "rsync://${1}:${port}/${2}" ) $( strquote "${3}" )
fi
return
}
#----------------------------------------------------------------
# These functions show rsync commands for hostname and IP address.
#----------------------------------------------------------------
function getip {
case $( exec uname -s ) in
( SunOS )
netstat -i -n | awk '{print $4;}'
;;
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux System Administration

Mastering Linux System Administration

Christine Bresnahan, Richard Blum
Mastering Linux Administration

Mastering Linux Administration

Alexandru Calcatinge, Julian Balog

Publisher Resources

ISBN: 9780596009526Supplemental ContentCatalog PageErrata