forked from ungleich-public/ccollect
Implemented very_verbose and changed standard behaviour. Also added some
more documentation
This commit is contained in:
parent
f9429a50bf
commit
f99404a04a
3 changed files with 34 additions and 9 deletions
15
ccollect.sh
15
ccollect.sh
|
@ -193,6 +193,7 @@ while [ "$i" -lt "$no_shares" ]; do
|
||||||
c_dest="$backup/destination"
|
c_dest="$backup/destination"
|
||||||
c_exclude="$backup/exclude"
|
c_exclude="$backup/exclude"
|
||||||
c_verbose="$backup/verbose"
|
c_verbose="$backup/verbose"
|
||||||
|
c_vverbose="$backup/very_verbose"
|
||||||
c_rsync_extra="$backup/rsync_options"
|
c_rsync_extra="$backup/rsync_options"
|
||||||
|
|
||||||
echo "Beginning to backup this source ..."
|
echo "Beginning to backup this source ..."
|
||||||
|
@ -227,6 +228,7 @@ while [ "$i" -lt "$no_shares" ]; do
|
||||||
# standard rsync options
|
# standard rsync options
|
||||||
#
|
#
|
||||||
VERBOSE=""
|
VERBOSE=""
|
||||||
|
VVERBOSE=""
|
||||||
EXCLUDE=""
|
EXCLUDE=""
|
||||||
RSYNC_EXTRA=""
|
RSYNC_EXTRA=""
|
||||||
|
|
||||||
|
@ -259,11 +261,16 @@ while [ "$i" -lt "$no_shares" ]; do
|
||||||
RSYNC_EXTRA="$(cat "$c_rsync_extra")"
|
RSYNC_EXTRA="$(cat "$c_rsync_extra")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# verbose
|
# verbosity for rsync
|
||||||
if [ -f "$c_verbose" ]; then
|
if [ -f "$c_verbose" ]; then
|
||||||
VERBOSE="-v"
|
VERBOSE="-v"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# verbosity for cp
|
||||||
|
if [ -f "$c_vverbose" ]; then
|
||||||
|
VVERBOSE="-v"
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# check if maximum number of backups is reached, if so remove
|
# check if maximum number of backups is reached, if so remove
|
||||||
#
|
#
|
||||||
|
@ -281,7 +288,7 @@ while [ "$i" -lt "$no_shares" ]; do
|
||||||
while read to_remove; do
|
while read to_remove; do
|
||||||
dir="$to_remove"
|
dir="$to_remove"
|
||||||
echo "Removing $dir ..."
|
echo "Removing $dir ..."
|
||||||
rm -rf "$dir"
|
rm $VVERBOSE -rf "$dir"
|
||||||
done < "$TMP"
|
done < "$TMP"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -300,10 +307,10 @@ while [ "$i" -lt "$no_shares" ]; do
|
||||||
# only copy if a directory exists
|
# only copy if a directory exists
|
||||||
if [ "$last_dir" ]; then
|
if [ "$last_dir" ]; then
|
||||||
echo "Hard linking..."
|
echo "Hard linking..."
|
||||||
cp -al $VERBOSE "$last_dir" "$destination_dir"
|
cp -al $VVERBOSE "$last_dir" "$destination_dir"
|
||||||
else
|
else
|
||||||
echo "Creating $destination_dir"
|
echo "Creating $destination_dir"
|
||||||
mkdir "$destination_dir"
|
mkdir $VVERBOSE "$destination_dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|
|
@ -263,7 +263,7 @@ div.exampleblock-content {
|
||||||
<span id="author">Nico Schottelius</span><br />
|
<span id="author">Nico Schottelius</span><br />
|
||||||
<span id="email"><tt><<a href="mailto:nico-linux-ccollect__@__schottelius.org">nico-linux-ccollect__@__schottelius.org</a>></tt></span><br />
|
<span id="email"><tt><<a href="mailto:nico-linux-ccollect__@__schottelius.org">nico-linux-ccollect__@__schottelius.org</a>></tt></span><br />
|
||||||
<span id="revision">version 0.2.2,</span>
|
<span id="revision">version 0.2.2,</span>
|
||||||
for ccollect 0.2, Initial Version 2005-01-13
|
for ccollect 0.2, Initial Version from 2005-01-13
|
||||||
</div>
|
</div>
|
||||||
<div id="preamble">
|
<div id="preamble">
|
||||||
<div class="sectionbody">
|
<div class="sectionbody">
|
||||||
|
@ -563,10 +563,17 @@ waste resources, but your backup will be complete.</p>
|
||||||
</div>
|
</div>
|
||||||
<h2>6. F.A.Q.</h2>
|
<h2>6. F.A.Q.</h2>
|
||||||
<div class="sectionbody">
|
<div class="sectionbody">
|
||||||
<h3>6.1. What happens, if one backup is broken / empty?</h3>
|
<h3>6.1. What happens, if one backup is broken or empty?</h3>
|
||||||
<p>Let us assume, that one backup failed (connection broke or hard disk had
|
<p>Let us assume, that one backup failed (connection broke or hard disk had
|
||||||
some failures). So we've one backup in our history, which is incomplete.</p>
|
some failures). So we've one backup in our history, which is incomplete.</p>
|
||||||
<p>The next time you use <tt>ccollect</tt>, it will transfer the missing files</p>
|
<p>The next time you use <tt>ccollect</tt>, it will transfer the missing files</p>
|
||||||
|
<h3>6.2. When backing up from localhost the destination is also included. Is this a bug?</h3>
|
||||||
|
<p>No. <tt>ccollect</tt> passes your source definition directly to <tt>rsync</tt>. It
|
||||||
|
does not try to analyze it. So it actually does not know if a source
|
||||||
|
comes from local harddisk or from a remote server. And it does not want
|
||||||
|
to. When you backup from the local harddisk (which is perhaps not
|
||||||
|
even a good idea when thinking of security) add the <tt>destination</tt>
|
||||||
|
to <em>source/exclude</em>. (Daniel Aubry reported this problem)</p>
|
||||||
</div>
|
</div>
|
||||||
<h2>7. Examples</h2>
|
<h2>7. Examples</h2>
|
||||||
<div class="sectionbody">
|
<div class="sectionbody">
|
||||||
|
@ -648,7 +655,7 @@ srwali01:/etc/ccollect/sources# du -sh /mnt/hdbackup/wl6/*
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<div id="footer-text">
|
<div id="footer-text">
|
||||||
Version 0.2.2<br />
|
Version 0.2.2<br />
|
||||||
Last updated 17-Jan-2006 12:59:55 CEST
|
Last updated 21-Jan-2006 11:37:48 CEST
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -313,8 +313,8 @@ waste resources, but your backup will be complete.
|
||||||
F.A.Q.
|
F.A.Q.
|
||||||
------
|
------
|
||||||
|
|
||||||
What happens, if one backup is broken / empty?
|
What happens, if one backup is broken or empty?
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Let us assume, that one backup failed (connection broke or hard disk had
|
Let us assume, that one backup failed (connection broke or hard disk had
|
||||||
some failures). So we've one backup in our history, which is incomplete.
|
some failures). So we've one backup in our history, which is incomplete.
|
||||||
|
@ -322,6 +322,17 @@ some failures). So we've one backup in our history, which is incomplete.
|
||||||
The next time you use `ccollect`, it will transfer the missing files
|
The next time you use `ccollect`, it will transfer the missing files
|
||||||
|
|
||||||
|
|
||||||
|
When backing up from localhost the destination is also included. Is this a bug?
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
No. `ccollect` passes your source definition directly to `rsync`. It
|
||||||
|
does not try to analyze it. So it actually does not know if a source
|
||||||
|
comes from local harddisk or from a remote server. And it does not want
|
||||||
|
to. When you backup from the local harddisk (which is perhaps not
|
||||||
|
even a good idea when thinking of security) add the `destination`
|
||||||
|
to 'source/exclude'. (Daniel Aubry reported this problem)
|
||||||
|
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue