Fixed exclude list bug, now ccollect is working as expected
This commit is contained in:
parent
8447c83165
commit
421daf2f66
2 changed files with 11 additions and 11 deletions
8
TODO
8
TODO
|
@ -1,6 +1,10 @@
|
|||
- write a manpage
|
||||
- implement verbosity
|
||||
o per source (-v to rsync)
|
||||
o general, very verbose (set -x)
|
||||
- implement general log
|
||||
- implement source specific backup
|
||||
- implement source specific log
|
||||
- implement parallel execution
|
||||
|
||||
DONE
|
||||
- implement verbosity
|
||||
o per source (-v to rsync)
|
||||
|
|
14
ccollect.sh
14
ccollect.sh
|
@ -210,9 +210,7 @@ while [ "$i" -lt "$no_shares" ]; do
|
|||
|
||||
# exclude
|
||||
if [ -f "$c_exclude" ]; then
|
||||
while read tmp; do
|
||||
EXCLUDE="$EXCLUDE --exclude=\"$tmp\""
|
||||
done < "$c_exclude"
|
||||
EXCLUDE="--exclude-from=$c_exclude"
|
||||
fi
|
||||
|
||||
# verbose
|
||||
|
@ -252,7 +250,7 @@ while [ "$i" -lt "$no_shares" ]; do
|
|||
|
||||
# only copy if a directory exists
|
||||
if [ "$last_dir" ]; then
|
||||
echo cp -al "$last_dir" "$destination_dir"
|
||||
# echo cp -al "$last_dir" "$destination_dir"
|
||||
cp $VERBOSE -al "$last_dir" "$destination_dir"
|
||||
else
|
||||
mkdir "$destination_dir"
|
||||
|
@ -267,11 +265,9 @@ while [ "$i" -lt "$no_shares" ]; do
|
|||
# the rsync part
|
||||
# options stolen shameless from rsnapshot
|
||||
#
|
||||
|
||||
echo rsync -a --delete --numeric-ids --relative --delete-excluded \
|
||||
$EXCLUDE $VERBOSE $EXCLUDE "$source" "$destination_dir"
|
||||
rsync -a --delete --numeric-ids --relative --delete-excluded \
|
||||
$EXCLUDE $VERBOSE $EXCLUDE "$source" "$destination_dir"
|
||||
|
||||
rsync -a $VERBOSE --delete --numeric-ids --relative --delete-excluded \
|
||||
"$EXCLUDE" $EXCLUDE "$source" "$destination_dir"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
errecho "rsync failed, backup most likely broken"
|
||||
|
|
Loading…
Reference in a new issue