SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux > SageTV for unRAID/Docker
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV for unRAID/Docker Discussion related to SageTV for unRAID/Docker. Questions, issues, problems, suggestions, etc. relating to SageTV for unRAID/Docker should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-05-2017, 03:35 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Need advice on Cron job to restart HD-PVRs

I continue to have minor issues with my HD-PVRs that are generally cured with a power cycle. So I have decided to power cycle them on a weekly basis when my appdata back up is running since that shuts down all dockers anyhow. And the dockers are out of commission for about 20 minutes every week from 03:00 to 03:20 on Monday. So power cycling the HD-PVRs at 3:05 on Mondays should work. In order to do this I had to switch from using my PC as a power supply to using wall warts again - so I bought some 3A wall warts on Amazon.

I have a Digital Loggers web controlled power switch. You can cycle power the outlets on this device with a curl command or with python code. I would also like to fire off an unRAID notification or an email to indicate that the power cycle has occurred.

Any suggestions on how to kick off the Cron job. I think there is a scheduler plugin. Is that the way to go? I think one downside to that is that I can't use Python since it isn't installed by default in the unRAID OS. Should I install Python? Is that a bad idea? Or should I just use a shell script with a curl command? Playing around in an unRAID ssh session is always painful IMHO as it often doesn't have stuff that you expect installed - like I think you have to use vim to edit the crontab file rather than nano - yuck!

I have an Ubuntu VM running on my unRAID server as well. Should I just run the cron job from there?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #2  
Old 10-05-2017, 04:12 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
I would suggest the "User Scripts" plugin if you want to setup a cron job. With it you can schedule and of the standard schedules like monthly, daily etc as a choice in the drop down. It also has a custom option that lets you make the cron entry so that you can schedule anything you want and are able to schedule with cron - which is almost anything. Also I believe as long as you also install python plugin in (Development Tools plugin I believe or Nerd tools maybe) it should be able to run it.
__________________
"Keep your goals away from the trolls"
Reply With Quote
  #3  
Old 10-05-2017, 05:50 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Thanks Bob - I did install Python via Nerdtools so hopefully that will do the trick.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #4  
Old 10-09-2017, 12:20 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
So I have this working now - I am just using a shell script. Note that this is for a Digital Loggers web power switch. It also sends an unRAID notification.

I didn't bother using the User Scripts plugin. I just created a new home directory called wayne and use a normal cron job created using crontab -e.

Note that this will be run while my dockers are being backed up. That happens at 3:00am on Mondays and takes at least 20 minutes. So this will cycle the HD-PVRs and SageTV will pick them up when it restarts after 3:20am.

Code:
# This script is called dli.sh and it has 755 mode
# This will control the web power switch
# It will be run in a cron job at 3:05 on Monday - so in cron that gives:  05 03 * * 1 /home/wayne/dli.sh
# It also creates a Notification in unRAID

curl http://user:password@192.168.1.20/outlet?2=CCL
curl http://user:password@192.168.1.20/outlet?7=CCL
/usr/local/emhttp/webGui/scripts/notify -e "Power Cycle" -s "HD-PVR event" -d "Both HD-PVRs were power cycled:" -i "normal"
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Do you have to restart the docker after power cycling HD-PVRs? wayner SageTV for unRAID/Docker 5 10-01-2017 11:46 AM
Any way to get HD300 to restart after server restart? oldmike60 SageTV Media Extender 17 06-15-2011 09:12 PM
Auto restart of hd-pvrs, best way to figure out a good time to recycle? WhiteWhisker SageTV Customizations 9 03-16-2010 03:45 PM
Are 4 HD-PVRs on WHS possible? bfb1963 Hardware Support 3 03-15-2009 08:05 PM
Scheduled Windows Restart / Reboot (Shutdown -r) and Sage doesn't restart dealsdyker SageTV Software 8 03-09-2007 04:24 PM


All times are GMT -6. The time now is 12:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.