[mythtv-users] optimize before shut down

Daryl McDonald darylangela at gmail.com
Tue Apr 23 20:23:47 UTC 2019


On Tue, Apr 23, 2019 at 2:29 PM Peter Bennett <pb.mythtv at gmail.com> wrote:

>
>
> On 4/23/19 1:36 PM, Daryl McDonald wrote:
>
>
>
> On Tue, Apr 23, 2019, 13:27 Peter Bennett <pb.mythtv at gmail.com> wrote:
>
>>
>> What I do is as follows:
>>
>> I have a script that gets run as the pre-shutdown check command. In
>> there I check date and time and decide whether certain things need to be
>> done (backup, optimize, other things). If it decides that, for example,
>> dailyrun.sh needs to run, it returns 1 to the check and starts up
>> dailyrun.sh. It continues to return 1 to the check until dailyrun.sh is
>> finished, then returns 0 which allows the shutdown. I keep files in a
>> directory with dates so that it knows if something is already run for
>> the day and does not run it again.
>>
>> See
>>
>> https://github.com/bennettpeter/mythscripts/blob/master/install/opt/mythtv/bin/mythshutdown.sh
>> for my script. It does a lot more than you are looking for, but may give
>> you some ideas. That script runs "dailyrun.sh" once a day, the first
>> time a shutdown occurs. I am not sure how you will know the last time a
>> shutdown occurs for the day, but running your optimize at the first
>> shutdown of the day should be just as good.
>>
>> Peter
>> _________________________________________
>>
>
> Yes Peter I think this is more of what I'm looking for, my question now
> is, since I already have a pre shutdown check working (to check if I'm
> logged in or not) how can these two be combined or will yours do what mine
> is already doing and thereby repaceable?
>
>>
>
> There are checks for users logged in via ssh, but you cannot just plug
> that script into your system. It has many other things that will not work
> for you without appropriate setups.
> ___________________________________________
>

It occurred to me I might be better off asking my son to adapt the check
login script I'm using now to include the optimize script. Thanks to all
for the input.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20190423/654839f0/attachment-0001.html>


More information about the mythtv-users mailing list