add luckys patches

idea looks good, patches need some claenups

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-07-23 18:55:25 +02:00
parent ed30a4d25b
commit c9472c5dff
5 changed files with 41 additions and 1 deletions

View file

@ -1 +1 @@
home.schottelius.org
localhost

View file

@ -0,0 +1,14 @@
31c31,41
< logdir="${LOGCONF}/destination"
---
> c_dest="${LOGCONF}/destination"
>
> if [ ! -f ${c_dest} ]; then
> _exit_err "Destination ${c_dest} is not a file. Skipping."
> else
> logdir=$(cat "${c_dest}"); ret="$?"
> if [ "${ret}" -ne 0 ]; then
> _exit_err "Destination ${c_dest} is not readable. Skipping."
> fi
> fi
>

View file

@ -0,0 +1,26 @@
#!/bin/sh
#
# 2007 Daniel Aubry
# 2008 Nico Schottelius (added minimal header)
#
# Copying license: GPL2-only
#
# TODO:
# add variables, add copying, add configuration
if [ ! -e /tmp/ccollect-stats.lock ]
then
touch /tmp/ccollect-stats.lock
# changes after license clearify
# for dest in /etc/ccollect/sources/ -type f -name destination | while read line
find /etc/ccollect/sources/*/destination | while read line
do
d=$(basename $(cat $line))
echo "====[Backup: $backupname]====" | tee -a /var/log/backup.log
du -sh $line/* | tee -a /var/log/backup.log
done
rm /tmp/ccollect-stats.lock
fi