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:
parent
504b9c7143
commit
33471a3c24
3 changed files with 41 additions and 25 deletions
|
@ -5,20 +5,21 @@ Nico Schottelius <nico-ccollect--@--schottelius.org>
|
|||
|
||||
NAME
|
||||
----
|
||||
add_ccollect_source - create new source for ccollect(1)
|
||||
ccollect_add_source - create new source for ccollect(1)
|
||||
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
|
||||
'add_ccollect_source.sh' <hostnames to create sources for>
|
||||
'ccollect_add_source.sh' <hostnames to create sources for>
|
||||
|
||||
|
||||
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
|
||||
'$CCOLLECT_CONF/sources'.
|
||||
'$CCOLLECT_CONF/sources'. It is designed to run on a backup server to create
|
||||
new directories for new hosts.
|
||||
|
||||
|
||||
FILES
|
||||
|
@ -41,8 +42,9 @@ very_verbose::
|
|||
|
||||
destination_base::
|
||||
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
|
||||
specified on the command line.
|
||||
`ccollect_add_source.sh` will create a directory with the hostname you
|
||||
specified on the command line. A common valua for `destination_base` is
|
||||
'/home/server/backup'.
|
||||
|
||||
source_prefix::
|
||||
source_postfix::
|
||||
|
@ -54,7 +56,7 @@ source_postfix::
|
|||
SEE ALSO
|
||||
--------
|
||||
ccollect(1), ccollect-logwrapper(1),
|
||||
delete_ccollect_source(1), list_ccollect_intervals(1)
|
||||
ccollect_delete_source(1), ccollect_list_intervals(1)
|
||||
|
||||
|
||||
AUTHOR
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
delete_ccollect_source(1)
|
||||
ccollect_delete_source(1)
|
||||
=========================
|
||||
Nico Schottelius <nico-ccollect--@--schottelius.org>
|
||||
|
||||
|
||||
NAME
|
||||
----
|
||||
delete_ccollect_source - delete sources from ccollect(1)
|
||||
ccollect_delete_source - delete sources from ccollect(1)
|
||||
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
'delete_ccollect_source.sh' [-d] [-f] <hostnames to create sources for>
|
||||
'ccollect_delete_source.sh' [-d] [-f] <hostnames to create sources for>
|
||||
|
||||
|
||||
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.
|
||||
|
||||
OPTIONS
|
||||
|
@ -36,8 +36,8 @@ $CCOLLECT_CONF/sources::
|
|||
|
||||
SEE ALSO
|
||||
--------
|
||||
add_ccollect_source(1), ccollect(1),
|
||||
ccollect-logwrapper(1), list_ccollect_intervals(1)
|
||||
ccollect_add_source(1), ccollect(1),
|
||||
ccollect-logwrapper(1), ccollect_list_intervals(1)
|
||||
|
||||
|
||||
AUTHOR
|
||||
|
@ -52,5 +52,5 @@ Main web site: http://unix.schottelius.org/ccollect/[]
|
|||
|
||||
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).
|
||||
|
|
|
@ -1,9 +1,24 @@
|
|||
#!/bin/sh
|
||||
# Nico Schottelius
|
||||
# 2007-08-16
|
||||
# Written for Netstream (www.netstream.ch)
|
||||
#
|
||||
# 2007-2008 Nico Schottelius (nico-ccollect at schottelius.org)
|
||||
#
|
||||
# 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).
|
||||
# Copying: GPLv3 (See file COPYING in top directory)
|
||||
|
||||
# standard values
|
||||
CCOLLECT_CONF="${CCOLLECT_CONF:-/etc/ccollect}"
|
||||
|
@ -37,11 +52,10 @@ force=""
|
|||
backups=""
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
|
||||
if [ "$params_possible" ]; then
|
||||
case "$1" in
|
||||
"-f"|"--force")
|
||||
force=yes
|
||||
force="-r"
|
||||
shift; continue
|
||||
;;
|
||||
"-d"|"--destination")
|
||||
|
@ -81,14 +95,14 @@ while [ $# -gt 0 ]; do
|
|||
fi
|
||||
|
||||
if [ "$backups" ]; then
|
||||
ddir=$(cd "${fullname}/destination" && pwd -P) || _exit_err "Cannot change to ${fullname}/destination"
|
||||
_echo "Deleting ${ddir} ..."
|
||||
rm -r "${ddir}"
|
||||
ddir="$(cat "${fullname}/destination")"
|
||||
addir="$(cd && pwd -P)" || _exit_err "Cannot change to ${ddir}"
|
||||
_echo "Deleting ${addir} ..."
|
||||
rm -r $force "${addir}"
|
||||
fi
|
||||
|
||||
_echo "Deleting ${fullname} ..."
|
||||
rm -r "${fullname}"
|
||||
|
||||
rm -r $force "${fullname}"
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in a new issue