Author Topic: Stop Cron job  (Read 118 times)

Offline uzelessknowledge

  • Hero Member
  • *****
  • Join Date: Jan 2015
  • Location: Alabaster, AL
  • Posts: 542
  • Kudos: 2
Stop Cron job
« on: November 08, 2017, 04:14:57 PM »
How do you stop a Cron job? I wrote a script to start a script at certain times. The cron job is starting, but when it does FPPD shows as stopped and I don't know how to stop the job from running.
Edit: when FPPD shows as stopped the sequence is still playing. Master and remote setup. Master shows FPPD stopped while remote shows its syncing to master.

Thanks
Travis
« Last Edit: November 08, 2017, 04:54:06 PM by uzelessknowledge »

Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,974
  • Kudos: 142
Re: Stop Cron job
« Reply #1 on: November 10, 2017, 10:58:46 PM »
If the master is stopped or killed, the remote will keep playing until the sequence ends.

If you want to stop your script from running, you will have to kill it from another script.
-
Chris

Offline uzelessknowledge

  • Hero Member
  • *****
  • Join Date: Jan 2015
  • Location: Alabaster, AL
  • Posts: 542
  • Kudos: 2
Re: Stop Cron job
« Reply #2 on: November 11, 2017, 05:37:14 AM »
If the master is stopped or killed, the remote will keep playing until the sequence ends.

If you want to stop your script from running, you will have to kill it from another script.
Gotcha. I had suspicion Id have to stop the remote with another script.

Why would the master FPPD stop when the cron job runs on it?


Sent from my iPhone using Tapatalk

Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,974
  • Kudos: 142
Re: Stop Cron job
« Reply #3 on: November 12, 2017, 12:41:48 AM »
Why would the master FPPD stop when the cron job runs on it?

That I'm not sure about.  What does the script do?  Is it something you can post here?

Offline uzelessknowledge

  • Hero Member
  • *****
  • Join Date: Jan 2015
  • Location: Alabaster, AL
  • Posts: 542
  • Kudos: 2
Re: Stop Cron job
« Reply #4 on: November 12, 2017, 07:21:18 AM »
What does the script do?  Is it something you can post here?

I have a small sequence that is just some color. A static type of display. Then every so often, 10 minutes, I wanted to start a musical sequence. I thought using a script would be a good idea. This is the script to stop the currently running sequence and start the musical sequence. Little -p means to loop and capital -P means to play once?

While I'd like to understand it I don't know that I need to have you look at it since I was able to modify the sequences and just use the playlist and scheduler to do this. Chris, I know your time is valuable this time of year.

Code: [Select]
#!/bin/sh
###########################################################
# StartPlaylist.sh - Start a playlist on the local system #
#                                                         #
# The Playlist will play once and then stop.              #
###########################################################

fpp -c stop

# Edit this line to hold the playlist name in quotes
PLAYLISTNAME="ARMED"

# If you want to start on a specfic numbered entry in the playlist
# then put the entry number inside the quotes on the line below
STARTITEM=""

fpp -P "${PLAYLISTNAME}" ${STARTITEM}

fpp -p "${Veterans_Day}" ${STARTITEM}

Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,974
  • Kudos: 142
Re: Stop Cron job
« Reply #5 on: November 15, 2017, 12:38:40 AM »
Try adding a "sleep 1" after the 'fpp -c stop' command to give the backend a little time to stop the playlist before starting another.  Maybe there is a race condition in the code.

 

Back to top