projects
/
outofuni
/
backup.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e60c46b
)
correct pid collection
author
hackbard
<hackbard@hackdaworld.org>
Tue, 13 Oct 2015 20:39:18 +0000
(22:39 +0200)
committer
hackbard
<hackbard@hackdaworld.org>
Tue, 13 Oct 2015 20:39:18 +0000
(22:39 +0200)
bin/backupctrl
patch
|
blob
|
history
diff --git
a/bin/backupctrl
b/bin/backupctrl
index
1315f84
..
f96e2fb
100755
(executable)
--- a/
bin/backupctrl
+++ b/
bin/backupctrl
@@
-5,13
+5,13
@@
op="pusage"
function detect() {
IFS=$'\n'
for psline in `ps -ef | grep [r]sync`; do
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
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 pos
sible backup process $ppid started at $pptime
+ echo
po
sible backup process $ppid started at $pptime
echo
if [ ! -z "$1" ]; then
if [ "$1" = "kill" ]; then
echo
if [ ! -z "$1" ]; then
if [ "$1" = "kill" ]; then
@@
-33,19
+33,16
@@
function detect() {
if [ ! -f ~/.backup ]; then
echo
echo "backup activated (no rejection file)"
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
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
detect
else
echo
echo backup rejected, $txt
- echo
detect "kill"
fi
fi
detect "kill"
fi
fi