14 Sep, 2009, Zeno wrote in the 1st comment:
Votes: 0
Asked on IMC, but MB apparently died for a few min and lost connection to Talon.

Anyway. I have a bash script:
#!/bin/bash
export FTP_PASSWORD=x
export PASSPHRASE=x
export TMPDIR=/root/duplicity/tmp

#http://wiki.kartbuilding.net/index.php/D...
#https://help.ubuntu.com/community/Duplic...

echo "======================================="
find . -maxdepth 1 -type d | while read dir; do
cd "$dir"
echo "in $dir"
duplicity /home/$dir/public_html scp://x@x.com//home/x/$dir –ssh-askpass –no-encryption
cd "$OLDPWD"
done

unset FTP_PASSWORD
unset PASSPHRASE


I ran it with ./backup.sh >> log.txt 2>&1
But for some reason there are 2 processes.
x      3273  0.0  0.0   5584  1032 pts/0    S+   12:53   0:00 /bin/bash ./backup.sh
x 3276 0.0 0.0 5584 536 pts/0 S+ 12:53 0:00 /bin/bash ./backup.sh

Is this normal behavior?
14 Sep, 2009, David Haley wrote in the 2nd comment:
Votes: 0
It might be forking a child process to handle the pipe or while loop or something like that; I'm not sure exactly how it handles things like that.
14 Sep, 2009, Zeno wrote in the 3rd comment:
Votes: 0
It is indeed a child process.
19307 19542 19542 19542 pts/0     3273 Ss       0   0:00  |   \_ -bash
19542 3273 3273 19542 pts/0 3273 S+ 0 0:00 | \_ /bin/bash ./backup.sh
3273 3276 3273 19542 pts/0 3273 S+ 0 0:00 | \_ /bin/bash ./backup.sh


Didn't want to assume it was normal though, since I'm going to be running this daily.
14 Sep, 2009, David Haley wrote in the 4th comment:
Votes: 0
Is there a problem with it being a child process? Is it taking up too many resources or something?
14 Sep, 2009, Zeno wrote in the 5th comment:
Votes: 0
Nope. Just one of those things that you don't want running twice. I don't write bash scripts often (why did I even make this in bash…) so I wasn't sure if I did something really wrong somewhere. :P
15 Sep, 2009, elanthis wrote in the 6th comment:
Votes: 0
It's the pipe you created on the while loop.

I'd suggest reading the Advanced Bash Scripting Guide (I think that's its name) for more information on the nitty gritty details.
0.0/6