7 for psline in `ps -ef | grep [r]sync`; do
8 ppid="`echo $psline | awk '{ print $2 }'`"
9 pptime=`echo $psline | awk '{ print $5 }'`
10 ppcmd="`echo $psline | \
11 sed 's/.*\(rsync .*\)/\1/'`"
13 echo posible backup process $ppid started at $pptime
15 if [ ! -z "$1" ]; then
16 if [ "$1" = "kill" ]; then
17 echo -en "want me to kill it? [y/N]: "
20 if [ "$answer" = "y" ]; then
32 if [ ! -f ~/.backup ]; then
34 echo "backup activated (no rejection file)"
37 txt="`grep ^# ~/.backup | cut -d ' ' -f 2-`"
38 if [ -z "`cat ~/.backup | grep ^off`" ]; then
40 echo backup activated, $txt
44 echo backup rejected, $txt
50 echo "# disabled at `date`" > ~/.backup
51 echo "off" >> ~/.backup
55 echo "# enabled at `date`" > ~/.backup
56 echo "on" >> ~/.backup
59 echo -en "\nusage:\n$0 [status|off|on]\n\n"