Closed irodimus closed 7 years ago
Ok cool, I just re-purposed my old updatechannels.sh
to do the job but realize I am not checking for running pid's! I'll incorporate your logic, or if yours works out of the box as you say I'll just use that!
I figured that already having PseudoChannel.py running, it would already update that channel anyway.
Oh, and feel free to add, modify, remove, dissect, etc any part of this. I just couldn't wait and thought I'd share it for those who were looking for something :)
Sounds great! I will absolutely give credit where credits due. Without testing it, it reads great. I may just add your script, put your username up top and add it to the scripts dir. Can you confirm it works with crontab? If so, does the user need to make crontab do anything special... like:
0 0 * * * cd /home/pi/channels/ bash ./generate-channels-daily-schedule.sh > /dev/null 2>&1
...I know often times cron needs to change dirs to make it work right (usually for py scripts). Maybe that's unnecessary?
Honestly, as a macOS user, there are some small changes I made to the shell scripts for my use case to resolve issues that would occur when I attempted to run them in my setup. I use launchd to set the calendar interval on when to run these scripts and not necessarily crontab so I can't say for sure since PseudoChannel is run on my Mac.
It would probably be better all around to adjust these scripts to run on your setup so others who download the pseudo-channel project don't have to make changes like I did. I tried my best to use put those variables and commands back to the original as possible as seen in your other shell scripts.
Having said that, they should still work fine without any major tweaking.
Here's the script I pieced together to update all the channels. The script loops through the channels and updates all of them unless it finds the
running.pid
file in the channel directory, in which case it will skip it and move to the next. The channel that is skipped will update according to the value in its channel'spseudo_config.py
file so it helps to set this script to run as a cron job at that same time.