Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #12649

Re: background processes (was HOW2 capture time of power-failure?)

From not.socialnetwork@gmail.com
Newsgroups comp.os.linux.misc, comp.sys.raspberry-pi
Subject Re: background processes (was HOW2 capture time of power-failure?)
Followup-To comp.os.linux.misc, comp.sys.raspberry-pi
Date 2014-11-08 03:32 +0000
Organization A noiseless patient Spider
Message-ID <m3k2rn$nlu$1@dont-email.me> (permalink)
References <m3ikud$dvn$1@dont-email.me>

Cross-posted to 2 groups.

Followups directed to: comp.os.linux.misc, comp.sys.raspberry-pi

Show all headers | View raw


In article <m3ikud$dvn$1@dont-email.me>, Joe Beanfish <joebeanfish@nospam.duh> wrote: 

> On Thu, 06 Nov 2014 19:19:01 +0000, not.socialnetwork wrote:
> > For my application, I want the player to be the boss - to start the
> > timer.
> > For 'civilised' code, the player would also switch-off the timer, which
> > would have recorded to LastTimeStamp.
> > For my application: cutting the power automatically syncronises the
> > <playEnd>  and last-TimeStamp.
> > ...
> > So the background timer would need to be started before the `play`.
> 
> Correct. Something like this perhaps:
> 
> #!/bin/sh
> while :;do date > TimeStamp;sleep 5;done &
> bgpid=$!
> StartPlay
> kill $bgpid
> rm -f TimeStamp
> ---
That seems to test GOOD on the live-PC.
I'll test by power-cut on rPi later.
 
JB.sh ==
#!/bin/sh
echo "IF State=Skip THEN PlayFrom(TimeStamp)"
echo -n "Previous TimeStamp="; cat TimeStamp

while :;do date > TimeStamp;sleep 5;done &
bgpid=$!
echo StartPlay;sleep 25
echo StillPlaying;sleep 25
echo "After Play stop: kill BakPID"
kill $bgpid
echo "TimeStamp is used by next Start/PowerUp:" 
echo -n "Currently="
cat TimeStamp 

exit 0

log of 2 consecutive runs ==
IF State=Skip THEN PlayFrom(TimeStamp)
Previous TimeStamp=Sat Nov  8 05:08:19 SAST 2014
StartPlay
StillPlaying
After Play stop: kill BakPID
TimeStamp is used by next Start/PowerUp:
Currently=Sat Nov  8 05:12:19 SAST 2014
./JB.sh: line 13: 20334 Terminated              while :; do
    date >TimeStamp; sleep 5;
done
===
IF State=Skip THEN PlayFrom(TimeStamp)
Previous TimeStamp=Sat Nov  8 05:12:19 SAST 2014
StartPlay
StillPlaying
After Play stop: kill BakPID
TimeStamp is used by next Start/PowerUp:
Currently=Sat Nov  8 05:13:57 SAST 2014
./JB.sh: line 13: 20360 Terminated              while :; do
    date >TimeStamp; sleep 5;
done
===

Thanks, I'll report the rPi live-test-results.

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

HOW2 capture time of power-failure? not.socialnetwork@gmail.com - 2014-10-26 17:38 +0000
  Re: HOW2 capture time of power-failure? Ian Malcolm <See.My.Sig.for.email@totally.invalid> - 2014-10-26 18:26 +0000
    Re: HOW2 capture time of power-failure? not.socialnetwork@gmail.com - 2014-10-27 18:10 +0000
      Re: HOW2 capture time of power-failure? Gordon Henderson <gordon+usenet@drogon.net> - 2014-10-27 18:29 +0000
        Re: HOW2 capture time of power-failure? not.socialnetwork@gmail.com - 2014-10-28 21:26 +0000
      Re: HOW2 capture time of power-failure? William Unruh <unruh@invalid.ca> - 2014-10-28 04:56 +0000
        Re: HOW2 capture time of power-failure? Dom <domafp@blueyonder.co.uk> - 2014-10-28 06:29 +0000
          Re: HOW2 capture time of power-failure? William Unruh <unruh@invalid.ca> - 2014-10-28 06:41 +0000
            Re: HOW2 capture time of power-failure? not.socialnetwork@gmail.com - 2014-10-29 00:12 +0000
  Re: HOW2 capture time of power-failure? William Unruh <unruh@invalid.ca> - 2014-10-26 19:23 +0000
    Re: HOW2 capture time of power-failure? spam-no-spam@Freeola.net.invalid (Windmill) - 2014-11-04 13:19 +0000
      Re: HOW2 capture time of power-failure? William Unruh <unruh@invalid.ca> - 2014-11-05 21:56 +0000
        Re: HOW2 capture time of power-failure? Joe Beanfish <joebeanfish@nospam.duh> - 2014-11-06 14:12 +0000
        Re: HOW2 capture time of power-failure? nba@users.sourceforge.net (Niels Baggesen) - 2014-11-06 16:15 +0100
          Re: HOW2 capture time of power-failure? William Unruh <unruh@invalid.ca> - 2014-11-06 16:00 +0000
        Re: HOW2 capture time of power-failure? spam-no-spam@Freeola.net.invalid (Windmill) - 2014-11-06 20:37 +0000
      Re: HOW2 capture time of power-failure? Joe Beanfish <joebeanfish@nospam.duh> - 2014-11-06 14:13 +0000
  Re: HOW2 capture time of power-failure? andrew@cucumber.demon.co.uk (Andrew Gabriel) - 2014-10-26 20:28 +0000
  Re: HOW2 capture time of power-failure? Joe Beanfish <joebeanfish@nospam.duh> - 2014-10-27 13:17 +0000
  Re: HOW2 capture time of power-failure? Jean-David Beyer <jeandavid8@verizon.net> - 2014-10-28 13:43 -0400
    Re: HOW2 capture time of power-failure? Ant <ant@zimage.comANT> - 2014-10-29 08:18 -0700
  Re: HOW2 capture time of power-failure? Joe Beanfish <joebeanfish@nospam.duh> - 2014-10-29 13:28 +0000
    Re: HOW2 capture time of power-failure? not.socialnetwork@gmail.com - 2014-10-30 08:32 +0000
      background processes (was HOW2 capture time of power-failure?) Joe Beanfish <joebeanfish@nospam.duh> - 2014-10-30 13:16 +0000
        Re: background processes (was HOW2 capture time of power-failure?) not.socialnetwork@gmail.com - 2014-11-03 03:25 +0000
          Re: background processes (was HOW2 capture time of power-failure?) "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2014-11-02 23:34 -0500
          Re: background processes (was HOW2 capture time of power-failure?) William Unruh <unruh@invalid.ca> - 2014-11-03 08:25 +0000
          Re: background processes (was HOW2 capture time of power-failure?) Martin Gregorie <martin@address-in-sig.invalid> - 2014-11-03 12:56 +0000
            Re: background processes (was HOW2 capture time of power-failure?) not.socialnetwork@gmail.com - 2014-11-06 19:19 +0000
              Re: background processes (was HOW2 capture time of power-failure?) Martin Gregorie <martin@address-in-sig.invalid> - 2014-11-07 02:36 +0000
              Re: background processes (was HOW2 capture time of power-failure?) Joe Beanfish <joebeanfish@nospam.duh> - 2014-11-07 14:28 +0000
                Re: background processes (was HOW2 capture time of power-failure?) not.socialnetwork@gmail.com - 2014-11-08 03:32 +0000

csiph-web