Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Ever get the feeling that the world's on tape and one of the reels is missing? -- Rich Little


aus+uk / uk.comp.os.linux / Re: Process Duplication Within for Loop

SubjectAuthor
o Re: Process Duplication Within for LoopJava Jive

1
Re: Process Duplication Within for Loop

<1703306233@f1.n221.z2.fidonet.fi>

  copy mid

https://www.novabbs.com/aus+uk/article-flat.php?id=280&group=uk.comp.os.linux#280

  copy link   Newsgroups: uk.comp.os.linux
Path: i2pn2.org!i2pn.org!aioe.org!gp956LlpOagiJ1e33vgjfg.user.46.165.242.75.POSTED!not-for-mail
From: Java.J...@f1.n221.z2.fidonet.fi (Java Jive)
Newsgroups: uk.comp.os.linux
Subject: Re: Process Duplication Within for Loop
Date: Sat, 24 Jul 2021 22:21:36 +0200
Organization: rbb soupgate
Message-ID: <1703306233@f1.n221.z2.fidonet.fi>
References: <229388451@f0.n0.z0.fidonet.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="5574"; posting-host="gp956LlpOagiJ1e33vgjfg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-MailConverter: SoupGate-OS/2 v1.20
X-Comment-To: All
X-Notice: Filtered by postfilter v. 0.9.2
 by: Java Jive - Sat, 24 Jul 2021 20:21 UTC

On 24/07/2021 14:40, Java Jive wrote:
> 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?

Thanks for both the replies. It seems there's nothing to worry about,
and the script seems to have been working aright anyhow.

--

Fake news kills!

I may be contacted via the contact address given on my website:
www.macfh.co.uk

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor