Plex update cron not working?

rmccullough

Patron
Joined
May 17, 2018
Messages
269
I created a cron job that runs every morning to update Plex. Here is the command:
iocage exec plex "pkg update ; pkg upgrade -y ; service plexmediaserver_plexpass restart"

I thought this had been working for a few months, but recently I added a similar cron job for all of my jails. I don't recall if Plex was one of the ones I added it for, or if this has been working for months.

Regardless, I do not receive an email with any kind of error. I just unchecked the checkbox for hiding standard output so I will see what that produces tomorrow.

The behavior seems to be that it does not fully restart Plex. If I run that command from a shell as root (not in the jail) it runs and brings Plex up. I just manually ran the cron job today because Plex wasn't up and it started it.

Do I need to add a sleep? Would it be better to stop the service, run the pkg commands, then start?
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
Not sure why plex didnt restart but after the upgrade you could just restart the entire jail to make sure it will be up, iocage restart -s plex
 
Top