Removed whitespaces, added Changes

This commit is contained in:
Nico Schottelius 2006-04-25 15:28:54 +02:00
parent 3081199b56
commit 1c7f824c19
3 changed files with 20 additions and 15 deletions

View File

@ -274,7 +274,7 @@ while [ "$i" -lt "$no_shares" ]; do
echo "Destination $c_dest does not link to a directory. Skipping" echo "Destination $c_dest does not link to a directory. Skipping"
exit 1 exit 1
fi fi
# #
# pre_exec # pre_exec
# #
@ -288,42 +288,42 @@ while [ "$i" -lt "$no_shares" ]; do
exit 1 exit 1
fi fi
fi fi
# exclude # exclude
if [ -f "$c_exclude" ]; then if [ -f "$c_exclude" ]; then
EXCLUDE="--exclude-from=$c_exclude" EXCLUDE="--exclude-from=$c_exclude"
fi fi
# extra options for rsync # extra options for rsync
if [ -f "$c_rsync_extra" ]; then if [ -f "$c_rsync_extra" ]; then
RSYNC_EXTRA="$(cat "$c_rsync_extra")" RSYNC_EXTRA="$(cat "$c_rsync_extra")"
fi fi
# Output a summary # Output a summary
if [ -f "$c_summary" ]; then if [ -f "$c_summary" ]; then
SUMMARY="--stats" SUMMARY="--stats"
fi fi
# Verbosity for rsync # Verbosity for rsync
if [ -f "$c_verbose" ]; then if [ -f "$c_verbose" ]; then
VERBOSE="-v" VERBOSE="-v"
fi fi
# MORE verbosity, includes standard verbosity # MORE verbosity, includes standard verbosity
if [ -f "$c_vverbose" ]; then if [ -f "$c_vverbose" ]; then
VERBOSE="-v" VERBOSE="-v"
VVERBOSE="-v" VVERBOSE="-v"
fi fi
# #
# check if maximum number of backups is reached, if so remove # check if maximum number of backups is reached, if so remove
# #
# the created directories are named $INTERVALL.$DA # the created directories are named $INTERVALL.$DA
count=$(ls -d "$c_dest/${INTERVALL}."?* 2>/dev/null | wc -l) count=$(ls -d "$c_dest/${INTERVALL}."?* 2>/dev/null | wc -l)
echo -n "Currently $count backup(s) exist(s)," echo -n "Currently $count backup(s) exist(s),"
echo " total keeping $c_intervall backup(s)." echo " total keeping $c_intervall backup(s)."
if [ "$count" -ge "$c_intervall" ]; then if [ "$count" -ge "$c_intervall" ]; then
substract=$(echo $c_intervall - 1 | bc) substract=$(echo $c_intervall - 1 | bc)
remove=$(echo $count - $substract | bc) remove=$(echo $count - $substract | bc)
@ -336,16 +336,16 @@ while [ "$i" -lt "$no_shares" ]; do
rm $VVERBOSE -rf "$dir" rm $VVERBOSE -rf "$dir"
done < "$TMP" done < "$TMP"
fi fi
# #
# clone the old directory with hardlinks # clone the old directory with hardlinks
# #
destination_date=$(date +%Y-%m-%d-%H%M) destination_date=$(date +%Y-%m-%d-%H%M)
destination_dir="$c_dest/${INTERVALL}.${destination_date}.$$" destination_dir="$c_dest/${INTERVALL}.${destination_date}.$$"
last_dir=$(ls -d "$c_dest/${INTERVALL}."?* 2>/dev/null | sort -n | tail -n 1) last_dir=$(ls -d "$c_dest/${INTERVALL}."?* 2>/dev/null | sort -n | tail -n 1)
# give some info # give some info
echo "Beginning to backup, this may take some time..." echo "Beginning to backup, this may take some time..."
@ -371,7 +371,7 @@ while [ "$i" -lt "$no_shares" ]; do
# the rsync part # the rsync part
# options partly stolen from rsnapshot # options partly stolen from rsnapshot
# #
echo "$(date) Transferring files..." echo "$(date) Transferring files..."
rsync -a $VERBOSE $RSYNC_EXTRA $EXCLUDE $SUMMARY \ rsync -a $VERBOSE $RSYNC_EXTRA $EXCLUDE $SUMMARY \
@ -425,7 +425,7 @@ if [ -x "$CPOSTEXEC" ]; then
echo "Executing $CPOSTEXEC ..." echo "Executing $CPOSTEXEC ..."
"$CPOSTEXEC" "$CPOSTEXEC"
echo "Finished ${CPOSTEXEC}." echo "Finished ${CPOSTEXEC}."
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$CPOSTEXEC failed." echo "$CPOSTEXEC failed."
fi fi

View File

@ -2,13 +2,15 @@
* `pax` (Posix) is now required, `cp -al` (GNU specific) is removed * `pax` (Posix) is now required, `cp -al` (GNU specific) is removed
* "interval" was written with two 'l' (ell), which is wrong in English * "interval" was written with two 'l' (ell), which is wrong in English
* Changed the name of backup directories, removed the colon in the interval * Changed the name of backup directories, removed the colon in the interval
* ccollect will now exit, when preexec returns non-zero
* ccollect now reports when postexec returns non-zero
0.3.2 to 0.3.3: 0.3.2 to 0.3.3:
* Fix a small bug, which suppressed information when rsync exits non-zero * Fix a small bug, which suppressed information when rsync exits non-zero
0.3.1 to 0.3.2: 0.3.1 to 0.3.2:
* ccollect now prints the start time, end time and duration of the backup * ccollect now prints the start time, end time and duration of the backup
0.3 to 0.3.1: 0.3 to 0.3.1:
* added support for printing a summary * added support for printing a summary
* some cosmetic changes * some cosmetic changes

View File

@ -47,6 +47,9 @@ versions:
- `pax` (Posix) is now required, `cp -al` (GNU specific) is removed - `pax` (Posix) is now required, `cp -al` (GNU specific) is removed
- "interval" was written with two 'l' (ell), which is wrong in English - "interval" was written with two 'l' (ell), which is wrong in English
- Changed the name of backup directories, removed the colon in the interval - Changed the name of backup directories, removed the colon in the interval
- ccollect will now exit, when preexec returns non-zero
- ccollect now reports when postexec returns non-zero
Requirements Requirements