update ccollect_delete_source.sh to 0.7 style

- and update manpages to the new names
- on the way home from duebendorf - rapperswil - bellinzona - giubiasco -
  zuerich - gossau!
This commit is contained in:
Nico Schottelius 2008-03-09 23:06:18 +01:00
parent 504b9c7143
commit 33471a3c24
3 changed files with 41 additions and 25 deletions

View file

@ -5,20 +5,21 @@ Nico Schottelius <nico-ccollect--@--schottelius.org>
NAME NAME
---- ----
add_ccollect_source - create new source for ccollect(1) ccollect_add_source - create new source for ccollect(1)
SYNOPSIS SYNOPSIS
-------- --------
'add_ccollect_source.sh' <hostnames to create sources for> 'ccollect_add_source.sh' <hostnames to create sources for>
DESCRIPTION DESCRIPTION
----------- -----------
add_ccollect_source.sh creates a new backup source for use with ccollect(1). ccollect_add_source.sh creates a new backup source for use with ccollect(1).
It copies the files from to the source directory with the hostname below It copies the files from to the source directory with the hostname below
'$CCOLLECT_CONF/sources'. '$CCOLLECT_CONF/sources'. It is designed to run on a backup server to create
new directories for new hosts.
FILES FILES
@ -41,8 +42,9 @@ very_verbose::
destination_base:: destination_base::
A link to the directory where to store the backups. Below this directory A link to the directory where to store the backups. Below this directory
`add_ccollect_source.sh` will create a directory with the hostname you `ccollect_add_source.sh` will create a directory with the hostname you
specified on the command line. specified on the command line. A common valua for `destination_base` is
'/home/server/backup'.
source_prefix:: source_prefix::
source_postfix:: source_postfix::
@ -54,7 +56,7 @@ source_postfix::
SEE ALSO SEE ALSO
-------- --------
ccollect(1), ccollect-logwrapper(1), ccollect(1), ccollect-logwrapper(1),
delete_ccollect_source(1), list_ccollect_intervals(1) ccollect_delete_source(1), ccollect_list_intervals(1)
AUTHOR AUTHOR

View file

@ -1,21 +1,21 @@
delete_ccollect_source(1) ccollect_delete_source(1)
========================= =========================
Nico Schottelius <nico-ccollect--@--schottelius.org> Nico Schottelius <nico-ccollect--@--schottelius.org>
NAME NAME
---- ----
delete_ccollect_source - delete sources from ccollect(1) ccollect_delete_source - delete sources from ccollect(1)
SYNOPSIS SYNOPSIS
-------- --------
'delete_ccollect_source.sh' [-d] [-f] <hostnames to create sources for> 'ccollect_delete_source.sh' [-d] [-f] <hostnames to create sources for>
DESCRIPTION DESCRIPTION
----------- -----------
delete_ccollect_source.sh deletes backup sources from ccollect(1) and optional ccollect_delete_source.sh deletes backup sources from ccollect(1) and optional
also the backups created for that source. also the backups created for that source.
OPTIONS OPTIONS
@ -36,8 +36,8 @@ $CCOLLECT_CONF/sources::
SEE ALSO SEE ALSO
-------- --------
add_ccollect_source(1), ccollect(1), ccollect_add_source(1), ccollect(1),
ccollect-logwrapper(1), list_ccollect_intervals(1) ccollect-logwrapper(1), ccollect_list_intervals(1)
AUTHOR AUTHOR
@ -52,5 +52,5 @@ Main web site: http://unix.schottelius.org/ccollect/[]
COPYING COPYING
------- -------
Copyright \(C) 2007 Nico Schottelius. Free use of this software is Copyright \(C) 2007-2008 Nico Schottelius. Free use of this software is
granted under the terms of the GNU General Public License Version 3 (GPLv3). granted under the terms of the GNU General Public License Version 3 (GPLv3).

View file

@ -1,9 +1,24 @@
#!/bin/sh #!/bin/sh
# Nico Schottelius #
# 2007-08-16 # 2007-2008 Nico Schottelius (nico-ccollect at schottelius.org)
# Written for Netstream (www.netstream.ch) #
# This file is part of ccollect.
#
# ccollect is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ccollect is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ccollect. If not, see <http://www.gnu.org/licenses/>.
#
# 2007-08-16 Written for Netstream (www.netstream.ch)
# Delete sources and their backups (optionally). # Delete sources and their backups (optionally).
# Copying: GPLv3 (See file COPYING in top directory)
# standard values # standard values
CCOLLECT_CONF="${CCOLLECT_CONF:-/etc/ccollect}" CCOLLECT_CONF="${CCOLLECT_CONF:-/etc/ccollect}"
@ -37,11 +52,10 @@ force=""
backups="" backups=""
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
if [ "$params_possible" ]; then if [ "$params_possible" ]; then
case "$1" in case "$1" in
"-f"|"--force") "-f"|"--force")
force=yes force="-r"
shift; continue shift; continue
;; ;;
"-d"|"--destination") "-d"|"--destination")
@ -81,14 +95,14 @@ while [ $# -gt 0 ]; do
fi fi
if [ "$backups" ]; then if [ "$backups" ]; then
ddir=$(cd "${fullname}/destination" && pwd -P) || _exit_err "Cannot change to ${fullname}/destination" ddir="$(cat "${fullname}/destination")"
_echo "Deleting ${ddir} ..." addir="$(cd && pwd -P)" || _exit_err "Cannot change to ${ddir}"
rm -r "${ddir}" _echo "Deleting ${addir} ..."
rm -r $force "${addir}"
fi fi
_echo "Deleting ${fullname} ..." _echo "Deleting ${fullname} ..."
rm -r "${fullname}" rm -r $force "${fullname}"
done done
exit 0 exit 0