function detect() {
IFS=$'\n'
for psline in `ps -ef | grep [r]sync`; do
- ppid="`echo $psline | cut -d ' ' -f 2`"
+ ppid="`echo $psline | awk '{ print $2 }'`"
pptime=`echo $psline | \
sed 's/.*[0-9] \([0-9][0-9]:[0-9][0-9]\) \?.*/\1/'`
ppcmd="`echo $psline | \
sed 's/.*\(rsync .*\)/\1/'`"
echo
- echo detected possible backup process $ppid started at $pptime
+ echo posible backup process $ppid started at $pptime
echo
if [ ! -z "$1" ]; then
if [ "$1" = "kill" ]; then
if [ ! -f ~/.backup ]; then
echo
echo "backup activated (no rejection file)"
- echo
detect
else
txt="`grep ^# ~/.backup | cut -d ' ' -f 2-`"
if [ -z "`cat ~/.backup | grep ^off`" ]; then
echo
echo backup activated, $txt
- echo
detect
else
echo
echo backup rejected, $txt
- echo
detect "kill"
fi
fi