7 for psline in `ps -ef | grep [r]sync`; do
8 ppid="`echo $psline | cut -d ' ' -f 2`"
9 pptime=`echo $psline | \
10 sed 's/.*[0-9] \([0-9][0-9]:[0-9][0-9]\) \?.*/\1/'`
11 ppcmd="`echo $psline | \
12 sed 's/.*\(rsync .*\)/\1/'`"
14 echo detected possible backup process $ppid started at $pptime
16 if [ ! -z "$1" ]; then
17 if [ "$1" = "kill" ]; then
18 echo -en "want me to kill it? [y/N]: "
21 if [ "$answer" = "y" ]; then
33 if [ ! -f ~/.backup ]; then
35 echo "backup activated (no rejection file)"
39 if [ -z "`cat ~/.backup | grep ^off`" ]; then
53 echo "# disabled at `date`" > ~/.backup
54 echo "off" >> ~/.backup
58 echo "# enabled at `date`" > ~/.backup
59 echo "on" >> ~/.backup
62 echo -en "\nusage:\n$0 [status|off|on]\n\n"