Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Plugin] CA User Scripts

Featured Replies

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

  • Replies 2.1k
  • Views 567k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • I could make up something long, convoluted, and technical as a reason why it doesn't do that but it would all be bs.  The simple answer is that when I did this, I never thought of that, and why it sti

  • Hi All - We have a fix and are publishing a Connect plugin update to fix it today. Thanks for letting us know.

  • @Squid I tried many commands and by that I found out that pkill does not kill (all) child processes: root@Thoth:/tmp# pgrep -f isleep2m | xargs --no-run-if-empty ps fp PID TTY STAT T

Posted Images

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?

  • Author
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

  • Author
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

 

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.

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?

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.

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.

  • Author
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.

The usage of the "stop" file is as undocumented as the usage of the folder "/extra" ...

 

  • Author
2 minutes ago, bonienl said:

"/extra"

That one though is common knowledge for anyone who came from v4/v5

1 minute ago, Squid said:

That one though is common knowledge for anyone who came from v4/v5

but still undocumented 😉

so, now i want to know what the extra folder is for!

Just now, bonienl said:

but still undocumented 😉

This /extra?

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 :)

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 by cybrnook

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.

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 by cybrnook

  • 2 weeks later...

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.

 

Clipboard01.jpg

  • Author

Have a single script that runs and calls each sub-script in turn

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 by hawihoney

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.

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?

 

  • Author

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

 

 

 

 

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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.