I have the following piece of code creating an rsync process launched in
the early hours of every morning to sync a NAS from another upstream. I
have only included the business part of the file, the beginning of it is
to do with setting up the variable values used in these lines. As you
will note, there are two debugging statements trapping the output of ps
...
# Debug Line 1:
ps | grep -v grep | grep tutsync.sh > $HD/rsync.log echo "Syncing the following shares with rsync: ${SHARES}" >> $HD/rsync.log for SHARE in ${SHARES}
do
# Debug Line 2:
ps | grep -v grep | grep tutsync.sh >> $HD/rsync.log
echo "nice -n ${NICE} rsync ${OPTIONS}
${SOURCE}/${SHARE}/ ${BU}/${SHARE}/"
nice -n ${NICE} rsync ${OPTIONS} ${SOURCE}/${SHARE}/ ${BU}/${SHARE}/
done | grep -v '/$' >> $HD/rsync.log 2>&1
... because, when run, the process appears to duplicate itself within
the for loop - not only does the tutsync.sh process itself get
duplicated, but also the rsync process it launches as well, as can be
proven by launching with a trailing & and running a similar command from
the shell:
~ # cat $HD/rsync.log 32453 root 2720 S /bin/sh /opt/share/bin/tutsync.sh Syncing the following shares with rsync: A
List Of Shares 32453 root 2720 S /bin/sh
/opt/share/bin/tutsync.sh 32458 root 2720 S /bin/sh /opt/share/bin/tutsync.sh receiving incremental file list etc
~ # pf rsync
9680 root 1972 S /opt/bin/rsync --ipv4 --daemon --config=/etc/rsyncd.conf 32467 root 2908 R N rsync -Drltugpv --exclude=*.flv --exclude=*.partial.* --exclude=*.part
--exclude=**/.streams 32468 root 49772 S N rsync -Drltugpv --exclude=*.flv --exclude=*.partial.* --exclude=*.part
--exclude=**/.streams
What is going on, why are the processes duplicating themselves?
I have the following piece of code creating an rsync process launched
in the early hours of every morning to sync a NAS from another
upstream. I have only included the business part of the file, the
beginning of it is to do with setting up the variable values used in
these lines. As you will note, there are two debugging statements
trapping the output of ps ...
# Debug Line 1:
ps | grep -v grep | grep tutsync.sh > $HD/rsync.log
echo "Syncing the following shares with rsync: ${SHARES}" >> $HD/rsync.log for SHARE in ${SHARES}
do
# Debug Line 2:
ps | grep -v grep | grep tutsync.sh >> $HD/rsync.log
echo "nice -n ${NICE} rsync ${OPTIONS}
${SOURCE}/${SHARE}/ ${BU}/${SHARE}/"
nice -n ${NICE} rsync ${OPTIONS} ${SOURCE}/${SHARE}/ ${BU}/${SHARE}/
done | grep -v '/$' >> $HD/rsync.log 2>&1
... because, when run, the process appears to duplicate itself within
the for loop - not only does the tutsync.sh process itself get
duplicated, but also the rsync process it launches as well, as can be
proven by launching with a trailing & and running a similar command
from the shell:
~ # cat $HD/rsync.log
32453 root 2720 S /bin/sh /opt/share/bin/tutsync.sh
Syncing the following shares with rsync: A List Of Shares
32453 root 2720 S /bin/sh /opt/share/bin/tutsync.sh
32458 root 2720 S /bin/sh /opt/share/bin/tutsync.sh
receiving incremental file list
etc
~ # pf rsync
9680 root 1972 S /opt/bin/rsync --ipv4 --daemon --config=/etc/rsyncd.conf
32467 root 2908 R N rsync -Drltugpv --exclude=*.flv --exclude=*.partial.* --exclude=*.part --exclude=**/.streams
32468 root 49772 S N rsync -Drltugpv --exclude=*.flv --exclude=*.partial.* --exclude=*.part --exclude=**/.streams
What is going on, why are the processes duplicating themselves?
I have the following piece of code creating an rsync process launched in
the early hours of every morning to sync a NAS from another upstream. I
have only included the business part of the file, the beginning of it is
to do with setting up the variable values used in these lines. As you
will note, there are two debugging statements trapping the output of ps
...
# Debug Line 1:
ps | grep -v grep | grep tutsync.sh > $HD/rsync.log echo "Syncing the following shares with rsync: ${SHARES}" >> $HD/rsync.log for SHARE in ${SHARES}
do
# Debug Line 2:
ps | grep -v grep | grep tutsync.sh >> $HD/rsync.log
echo "nice -n ${NICE} rsync ${OPTIONS}
${SOURCE}/${SHARE}/ ${BU}/${SHARE}/"
nice -n ${NICE} rsync ${OPTIONS} ${SOURCE}/${SHARE}/ ${BU}/${SHARE}/
done | grep -v '/$' >> $HD/rsync.log 2>&1
... because, when run, the process appears to duplicate itself within
the for loop - not only does the tutsync.sh process itself get
duplicated, but also the rsync process it launches as well, as can be
proven by launching with a trailing & and running a similar command from
the shell:
~ # cat $HD/rsync.log 32453 root 2720 S /bin/sh /opt/share/bin/tutsync.sh Syncing the following shares with rsync: A
List Of Shares 32453 root 2720 S /bin/sh
/opt/share/bin/tutsync.sh 32458 root 2720 S /bin/sh /opt/share/bin/tutsync.sh receiving incremental file list etc
~ # pf rsync
9680 root 1972 S /opt/bin/rsync --ipv4 --daemon --config=/etc/rsyncd.conf 32467 root 2908 R N rsync -Drltugpv --exclude=*.flv --exclude=*.partial.* --exclude=*.part
--exclude=**/.streams 32468 root 49772 S N rsync -Drltugpv --exclude=*.flv --exclude=*.partial.* --exclude=*.part
--exclude=**/.streams
What is going on, why are the processes duplicating themselves?
I have the following piece of code creating an rsync process launched in
the early hours of every morning to sync a NAS from another upstream. I have only included the business part of the file, the beginning of it is
to do with setting up the variable values used in these lines. As you
will note, there are two debugging statements trapping the output of ps ...
# Debug Line 1:
ps | grep -v grep | grep tutsync.sh > $HD/rsync.log
echo "Syncing the following shares with rsync: ${SHARES}" >> $HD/rsync.log for SHARE in ${SHARES}
do
# Debug Line 2:
ps | grep -v grep | grep tutsync.sh >> $HD/rsync.log
echo "nice -n ${NICE} rsync ${OPTIONS} ${SOURCE}/${SHARE}/ ${BU}/${SHARE}/"
nice -n ${NICE} rsync ${OPTIONS} ${SOURCE}/${SHARE}/
${BU}/${SHARE}/
done | grep -v '/$' >> $HD/rsync.log 2>&1
... because, when run, the process appears to duplicate itself within
the for loop - not only does the tutsync.sh process itself get duplicated, but also the rsync process it launches as well, as can be
proven by launching with a trailing & and running a similar command from
the shell:
~ # cat $HD/rsync.log
32453 root 2720 S /bin/sh /opt/share/bin/tutsync.sh
Syncing the following shares with rsync: A List Of Shares
32453 root 2720 S /bin/sh /opt/share/bin/tutsync.sh
32458 root 2720 S /bin/sh /opt/share/bin/tutsync.sh
receiving incremental file list
etc
~ # pf rsync
9680 root 1972 S /opt/bin/rsync --ipv4 --daemon --config=/etc/rsyncd.conf
32467 root 2908 R N rsync -Drltugpv --exclude=*.flv --exclude=*.partial.* --exclude=*.part --exclude=**/.streams
32468 root 49772 S N rsync -Drltugpv --exclude=*.flv --exclude=*.partial.* --exclude=*.part --exclude=**/.streams
What is going on, why are the processes duplicating themselves?
I have the following piece of code creating an rsync process launched in
the early hours of every morning to sync a NAS from another upstream. I have only included the business part of the file, the beginning of it is
to do with setting up the variable values used in these lines. As you
will note, there are two debugging statements trapping the output of ps ...
# Debug Line 1:
ps | grep -v grep | grep tutsync.sh > $HD/rsync.log
echo "Syncing the following shares with rsync: ${SHARES}" >> $HD/rsync.log for SHARE in ${SHARES}
do
# Debug Line 2:
ps | grep -v grep | grep tutsync.sh >> $HD/rsync.log
echo "nice -n ${NICE} rsync ${OPTIONS} ${SOURCE}/${SHARE}/ ${BU}/${SHARE}/"
nice -n ${NICE} rsync ${OPTIONS} ${SOURCE}/${SHARE}/
${BU}/${SHARE}/
done | grep -v '/$' >> $HD/rsync.log 2>&1
... because, when run, the process appears to duplicate itself within
the for loop - not only does the tutsync.sh process itself get duplicated, but also the rsync process it launches as well, as can be
proven by launching with a trailing & and running a similar command from
the shell:
~ # cat $HD/rsync.log
32453 root 2720 S /bin/sh /opt/share/bin/tutsync.sh
Syncing the following shares with rsync: A List Of Shares
32453 root 2720 S /bin/sh /opt/share/bin/tutsync.sh
32458 root 2720 S /bin/sh /opt/share/bin/tutsync.sh
receiving incremental file list
etc
~ # pf rsync
9680 root 1972 S /opt/bin/rsync --ipv4 --daemon --config=/etc/rsyncd.conf
32467 root 2908 R N rsync -Drltugpv --exclude=*.flv --exclude=*.partial.* --exclude=*.part --exclude=**/.streams
32468 root 49772 S N rsync -Drltugpv --exclude=*.flv --exclude=*.partial.* --exclude=*.part --exclude=**/.streams
What is going on, why are the processes duplicating themselves?
Running ps with the f option will give you a clearer picture of process relations
5467 ? Ss 0:02 sshd: /usr/sbin/sshd -f /etc/ssh/sshd_config
13958 ? Ss 0:00 \_ sshd: user1 [priv]
13960 ? S 0:01 \_ sshd: user1@pts/4
13962 pts/4 Ss 0:00 \_ -bash
18569 pts/4 S 0:00 \_ su -
18571 pts/4 S 0:00 \_ -su 20700 pts/4 R+ 0:00 \_ ps axf
I have the following piece of code creating an rsync process launched in
the early hours of every morning to sync a NAS from another upstream. I have only included the business part of the file, the beginning of it is
to do with setting up the variable values used in these lines. As you
will note, there are two debugging statements trapping the output of ps ...
# Debug Line 1:
ps | grep -v grep | grep tutsync.sh > $HD/rsync.log
echo "Syncing the following shares with rsync: ${SHARES}" >> $HD/rsync.log for SHARE in ${SHARES}
do
# Debug Line 2:
ps | grep -v grep | grep tutsync.sh >> $HD/rsync.log
echo "nice -n ${NICE} rsync ${OPTIONS} ${SOURCE}/${SHARE}/ ${BU}/${SHARE}/"
nice -n ${NICE} rsync ${OPTIONS} ${SOURCE}/${SHARE}/
${BU}/${SHARE}/
done | grep -v '/$' >> $HD/rsync.log 2>&1
... because, when run, the process appears to duplicate itself within
the for loop - not only does the tutsync.sh process itself get duplicated, but also the rsync process it launches as well, as can be
proven by launching with a trailing & and running a similar command from
the shell:
~ # cat $HD/rsync.log
32453 root 2720 S /bin/sh /opt/share/bin/tutsync.sh
Syncing the following shares with rsync: A List Of Shares
32453 root 2720 S /bin/sh /opt/share/bin/tutsync.sh
32458 root 2720 S /bin/sh /opt/share/bin/tutsync.sh
receiving incremental file list
etc
~ # pf rsync
9680 root 1972 S /opt/bin/rsync --ipv4 --daemon --config=/etc/rsyncd.conf
32467 root 2908 R N rsync -Drltugpv --exclude=*.flv --exclude=*.partial.* --exclude=*.part --exclude=**/.streams
32468 root 49772 S N rsync -Drltugpv --exclude=*.flv --exclude=*.partial.* --exclude=*.part --exclude=**/.streams
What is going on, why are the processes duplicating themselves?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 185 |
Nodes: | 16 (1 / 15) |
Uptime: | 135:13:58 |
Calls: | 3,758 |
Calls today: | 2 |
Files: | 11,180 |
Messages: | 3,469,274 |