DZMM Posted September 20, 2019 Share Posted September 20, 2019 Hi can I get some help with what is probably an easy fix please. I've started using this python utility https://github.com/adamgot/python-plexlibrary where I've saved the files to /mnt/user/appdata/other/python-plexlibrary-master. When I run the python utility via command line from the folder e.g. python plexlibrary movies_recommended everything works fine, but when I try to do via script e.g: #!/bin/bash cd /mnt/user/appdata/other/python-plexlibrary-master python plexlibrary movies_recommended exit I get this error: Traceback (most recent call last): File "/usr/lib64/python2.7/runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/mnt/user/appdata/other/python-plexlibrary-master/plexlibrary/__main__.py", line 3, in main() File "plexlibrary/plexlibrary.py", line 61, in main r.run(args.sort_only) File "plexlibrary/recipe.py", line 696, in run missing_items, list_count = self._run() File "plexlibrary/recipe.py", line 172, in _run matching_total, item['title'], item['year'])) UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 23: ordinal not in range(128) I've also tried: #!/usr/bin/env python cd /mnt/user/appdata/other/python-plexlibrary-master plexlibrary movies_recommended plexlibrary movies_imdb_top_250 exit Help please Help please Quote Link to comment
Julius Posted September 23, 2019 Share Posted September 23, 2019 Does the 'At startup of Array' run before or after the go script? Does the 'At startup of Array' execute before or after ssh service daemon starts? Is there a chart somewhere showing the runtime levels (or order) per plugin or service? Quote Link to comment
Squid Posted September 23, 2019 Author Share Posted September 23, 2019 3 minutes ago, Julius said: Does the 'At startup of Array' run before or after the go script? Way, way after. When the array is actually started. 3 minutes ago, Julius said: Does the 'At startup of Array' execute before or after ssh service daemon starts? I would think after Quote Link to comment
Squid Posted September 23, 2019 Author Share Posted September 23, 2019 4 minutes ago, Julius said: Is there a chart somewhere showing the runtime levels (or order) per plugin or service? cat /usr/local/sbin/emhttp_event 1 Quote Link to comment
itimpi Posted September 24, 2019 Share Posted September 24, 2019 Use the 'go' file for commands you want run as part of the Unraid boot process and a 'stop' file for commands to be run when the system is shutting down. The User Scripts plugin is for scripts to be used during normal Unraid operation. 1 Quote Link to comment
ICDeadPpl Posted September 24, 2019 Share Posted September 24, 2019 2 hours ago, itimpi said: Use the 'go' file for commands you want run as part of the Unraid boot process and a 'stop' file for commands to be run when the system is shutting down. The User Scripts plugin is for scripts to be used during normal Unraid operation. Is the 'stop' file supposed to be in the '/boot/config/' also? Quote Link to comment
itimpi Posted September 24, 2019 Share Posted September 24, 2019 12 minutes ago, ICDeadPpl said: Is the 'stop' file supposed to be in the '/boot/config/' also? Yes. It goes in the same location as the ‘go’ file. I am not sure why Limetech do not provide a dummy file as part of the standard release. Quote Link to comment
Cessquill Posted September 24, 2019 Share Posted September 24, 2019 1 hour ago, itimpi said: Yes. It goes in the same location as the ‘go’ file. I am not sure why Limetech do not provide a dummy file as part of the standard release. You learn something new every day - didn't know about a stop file. In an ideal world there'd also be something like go_user and stop_user files that are called from go and stop where all custom config would go, leaving the core files stock and safe to update. 1 Quote Link to comment
Squid Posted September 26, 2019 Author Share Posted September 26, 2019 On 9/24/2019 at 5:29 AM, Cessquill said: didn't know about a stop file. It's a very esoteric piece of knowledge (and not documented anywhere). I found out about it this July, and it seems that only @BRiT and @itimpi knew about it previously. 1 Quote Link to comment
bonienl Posted September 26, 2019 Share Posted September 26, 2019 The usage of the "stop" file is as undocumented as the usage of the folder "/extra" ... Quote Link to comment
Squid Posted September 26, 2019 Author Share Posted September 26, 2019 2 minutes ago, bonienl said: "/extra" That one though is common knowledge for anyone who came from v4/v5 Quote Link to comment
bonienl Posted September 26, 2019 Share Posted September 26, 2019 1 minute ago, Squid said: That one though is common knowledge for anyone who came from v4/v5 but still undocumented 😉 Quote Link to comment
NewDisplayName Posted September 26, 2019 Share Posted September 26, 2019 so, now i want to know what the extra folder is for! Quote Link to comment
Cessquill Posted September 26, 2019 Share Posted September 26, 2019 Just now, bonienl said: but still undocumented 😉 This /extra? 1 Quote Link to comment
bonienl Posted September 26, 2019 Share Posted September 26, 2019 1 minute ago, Cessquill said: This /extra? haha, not as undocumented as I thought 😄 Quote Link to comment
Cessquill Posted September 26, 2019 Share Posted September 26, 2019 12 minutes ago, bonienl said: haha, not as undocumented as I thought 😄 I only stumbled on it as I didn't know what you guys were talking about Quote Link to comment
cybrnook Posted September 27, 2019 Share Posted September 27, 2019 (edited) 19 hours ago, bonienl said: haha, not as undocumented as I thought 😄 🙂 I've also been using the /extra folder for quite some time. It saves me from having to install the nerdpack plugins, since I can just cherry pick the few packages I need (perl, pigz, ipmi tool, etc...). As well, I can pull from public repo's and update them when I want to, instead of having to bother a dev in here to update a package. stop file is new though! At what part in the shutdown sequence does it run, prior to stopping the array, or after all processes have been stopped right before power off? Edited September 27, 2019 by cybrnook Quote Link to comment
itimpi Posted September 27, 2019 Share Posted September 27, 2019 Stop file is definitely run after the array has been shut down, but I am not sure about other system services that are not dependent on the array. I will have to add a log message to mine to see exactly when it is run. Quote Link to comment
cybrnook Posted September 27, 2019 Share Posted September 27, 2019 (edited) Thanks @itimpi , I have played in SLES in the past using the halt.local and after.local functionality. However, on shutdown (halt.local), I always ran into that timing issue of where in the shutdown process it executed and it was always later in the shutdown sequence than would have ever done me any good, which is why I asked. Ended up just creating some daemon processes that a clean shutdown would tackle. NOTE: Not that there is any issues I have today during shutdown that Unraid is not already taking care of for me. Edited September 27, 2019 by cybrnook Quote Link to comment
hawihoney Posted October 8, 2019 Share Posted October 8, 2019 After many months of usage, I realized today, that the user scripts seem to run in parallel (see image attached). As I do have scripts that need to run after each other, how can I force that? Many thanks in advance. Quote Link to comment
Squid Posted October 8, 2019 Author Share Posted October 8, 2019 Have a single script that runs and calls each sub-script in turn Quote Link to comment
hawihoney Posted October 8, 2019 Share Posted October 8, 2019 (edited) So I build my own Daily, Weekly, Hourly scripts? Ah, I see. Thought User Scripts would work that way. Will do it. NowI do understand why my M.2 NVMs report high temperatures in the night. No good idea to start approx. six daily scripts at once. Thanks. Edited October 8, 2019 by hawihoney Quote Link to comment
Cessquill Posted October 9, 2019 Share Posted October 9, 2019 22 hours ago, hawihoney said: So I build my own Daily, Weekly, Hourly scripts? I think it's more that you create and schedule one script, and that script calls all the others one after another. Or you could apply a custom schedule to your scripts and have them run - say - 30 minutes apart. Quote Link to comment
hawihoney Posted October 9, 2019 Share Posted October 9, 2019 I did use User Scripts because I was under a wrong Impression. I thought if there are catagories (Daily, ...) the Plugin would call all Scripts of the same category in order - one after another and not all at once. BTW, why would one call a bunch of Daily Scripts at once? Quote Link to comment
Squid Posted October 9, 2019 Author Share Posted October 9, 2019 Probably because I'd then be inundated with requests to specify an execution order [emoji6] That, and people are leveraging this plugin to do things I never considered. Sent from my NSA monitored device Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.