Cessquill Posted November 25, 2020 Share Posted November 25, 2020 1 hour ago, jmbailey2000 said: crontab.guru is an online page that I use. Let's me put stuff in and shows you the result. Also has a huge page of examples of almost every type. Yes, I've used a couple of different ones, but like I say - the reference on the plugin page is useful as it shows the format that it specifically accepts. Quote Link to comment
thymon Posted November 27, 2020 Share Posted November 27, 2020 (edited) hello, I'm noob to use a script... Can I run this example : docker exec -it nextcloud sudo -u abc php7 /config/www/nextcloud/occ files:scan --all Edited November 27, 2020 by thymon Quote Link to comment
Squid Posted November 28, 2020 Author Share Posted November 28, 2020 You definitely want to get rid of the -i as that means interactive Quote Link to comment
thymon Posted November 28, 2020 Share Posted November 28, 2020 6 hours ago, Squid said: You definitely want to get rid of the -i as that means interactive nice ! Thanks 😊 Quote Link to comment
MajorTomG Posted December 6, 2020 Share Posted December 6, 2020 I'm new to this and I'm hoping I can use this plugin to call the radarr V3 API. Specifically the /command endpoint ImportListSyncCommand. Is this possible? Where would I start? Quote Link to comment
trurl Posted December 6, 2020 Share Posted December 6, 2020 48 minutes ago, MajorTomG said: I'm new to this and I'm hoping I can use this plugin to call the radarr V3 API. Specifically the /command endpoint ImportListSyncCommand. Is this possible? Where would I start? See a few posts above for another example of running a command inside a docker. Quote Link to comment
Stupifier Posted December 7, 2020 Share Posted December 7, 2020 How do I run any CA Userscript Script from within a Terminal Session? I know copies of scripts are held and ran from " /tmp/user.scripts/tmpScripts"....but when I go there via Terminal...I don't see ALL of my scripts listed (only a subset). It appears the only scripts listed here are ones which have been previously executed through Userscripts GUI. I know scripts are also located in "/boot/config/plugins/user.scripts/scripts" but those are all buttoned up with permissions restricting run (probably for good reason too since its the flash drive). Quote Link to comment
zaymus Posted December 7, 2020 Share Posted December 7, 2020 I'm trying to host a discord bot I made in python using the discordpy library, and I wanted to have the script ran every hour. however I'm not to experienced with bash so i'm a little stuck on running the script. this is the code I tried and I have installed the nerdpack plugin and enabled python3 in the settings. I have also rebooted my server after installing/enabling #!/bin/bash cd /mnt/user/scripts/Predicting_Alpha_Bot python bot.py When I run the script using the user script plugin it shows an error saying unknown command 'python'. I'm not sure if I have to specify the python path or anything so any help would be greatly appreciated! Quote Link to comment
trurl Posted December 7, 2020 Share Posted December 7, 2020 7 minutes ago, zaymus said: specify the python path Try it Quote Link to comment
zaymus Posted December 7, 2020 Share Posted December 7, 2020 24 minutes ago, trurl said: Try it I'm new to unraid and not very experienced in bash so I'm not really sure how to try it or find the python path Quote Link to comment
hawihoney Posted December 9, 2020 Share Posted December 9, 2020 [BUG] German Umlauts [äöüÄÖÜß] disappear during save I do have some scripts that do require German Umlauts (see above). I can put them into the big edit field but they disappear after saving the user script. For example: Within a user script I do call a python script to export data. I enter something like that (shortened): python3 [path]/ExportData.py -l Hörbücher After saving and reopening the script this is what became stored: python3 [path]/ExportData.py -l Hrbcher Thanks. Quote Link to comment
Squid Posted December 9, 2020 Author Share Posted December 9, 2020 Yeah, it's not a bug, but by design. Trouble is that there were so many users copying / pasting scripts from the forums here and doing that introduces other unwanted characters into the script, that all non pure ASCII characters were removed. I'll revisit next week. Quote Link to comment
zaymus Posted December 9, 2020 Share Posted December 9, 2020 (edited) I have a python script that is being ran by the user script plug in however i'm using a package that is not native to python so I was wondering how I would install it on my server so that it can be used by my script. I tried pip installing it through the command line but got some errors so im wondering if there is another way. I have the error message in this file if needed. install error message.txt Edited December 9, 2020 by zaymus added file Quote Link to comment
hawihoney Posted December 11, 2020 Share Posted December 11, 2020 On 12/9/2020 at 2:48 PM, Squid said: Yeah, it's not a bug, but by design. Trouble is that there were so many users copying / pasting scripts from the forums here and doing that introduces other unwanted characters into the script, that all non pure ASCII characters were removed. I'll revisit next week. Thanks in advance. IMHO: Don't modify user content in an entryfield automatically. It becomes a can of worms to decide and filter what's unwanted and what's intended. If you need to, check for unwanted characters and simply popup a small dialog "Non-ASCII characters detected. Are you sure?" and let the user decide. Quote Link to comment
Squid Posted December 11, 2020 Author Share Posted December 11, 2020 I reverted it. (It was originally put in in 2017) Quote Link to comment
primeval_god Posted December 11, 2020 Share Posted December 11, 2020 On 12/9/2020 at 11:36 AM, zaymus said: I have a python script that is being ran by the user script plug in however i'm using a package that is not native to python so I was wondering how I would install it on my server so that it can be used by my script. I tried pip installing it through the command line but got some errors so im wondering if there is another way. I have the error message in this file if needed. install error message.txt My suggestion is to build a docker image (using one of the official python base images), include your python script (run it from the entrypoint) and all of its dependencies. Then run the container from your user script. Quote Link to comment
MtX Posted December 12, 2020 Share Posted December 12, 2020 Im having a bit of an issue where aborting a script doesn't actually kill it. Is there a workaround so I don't have to manually hunt down and kill all the process every time. Thanks Quote Link to comment
Opawesome Posted December 12, 2020 Share Posted December 12, 2020 Hi all, Sorry for the dumb question but: I want to execute a script created with the "CA User Scripts" plugin not from the Unraid GUI but from the terminal (or from another script for that matter). What is the simplest way to do so? I indeed noticed that the "/tmp/user.scripts/tmpScripts" directory only contains scripts which were previously run from the Unraid GUI, and that in the "/boot/config/plugins/user.scripts/scripts" directory, the scripts permissions are set to 600 which make them not executable. Many thanks, Best OP Quote Link to comment
Squid Posted December 12, 2020 Author Share Posted December 12, 2020 14 minutes ago, Opawesome said: in the "/boot/config/plugins/user.scripts/scripts" directory, the scripts permissions are set to 600 which make them not executable. Security precaution in Unraid. use this /bin/bash /boot/config/plugins/user.scripts/scripts/..... 1 Quote Link to comment
Opawesome Posted December 12, 2020 Share Posted December 12, 2020 28 minutes ago, Squid said: Security precaution in Unraid. use this /bin/bash /boot/config/plugins/user.scripts/scripts/..... Dear Mr. @Squid., Awesome. You always come with such simple and elegant solutions . Thank you very much. Best regards, OP Quote Link to comment
barrygordon Posted December 14, 2020 Share Posted December 14, 2020 I am looking for a script that would monitor a TCP port and accept commands to spinup, spindown, or return status of a disk. The the minimum capability I need would be a command to spin up all the disks in the array. I could have them spin down after 4 hours of inactivity. The major use of the array is to feed my own home theater movie system. The delay when loading a movie bothers me and I would like to spin up the the array disks when I open the theater's movie librarian. It is my belief that if disks are generally not being used keeping them in a spun down state will increase their longevity Any help or advice would be greatly appreciated. Quote Link to comment
morallydubious Posted December 17, 2020 Share Posted December 17, 2020 Hello all, Thought I would post my experience here since my search-fu didn't come up with an answer, and someone else may have the same issue. I wanted to create a simple script to reboot my server once a week. My script worked when manually executed (RUN SCRIPT). However I was unable to make any schedule stick. I noticed that when hovering over the cog for pre-installed docker restart $(docker ps -q) no options appeared. The contents /boot/config/plugins/user.scripts/scripts contained the directory: docker\ restart\ $docker\ ps\ -q/ I renamed this directory to docker_restart and refreshed the User Scripts page and now hovering over cog displays options and I can apply a schedule to my new script. Cheers Quote Link to comment
Squid Posted December 17, 2020 Author Share Posted December 17, 2020 Don't name the script (as you did) using special characters Quote Link to comment
morallydubious Posted December 17, 2020 Share Posted December 17, 2020 1 minute ago, Squid said: Don't name the script (as you did) using special characters That one isn't mine. It was one of the ones created when I installed the plugin Quote Link to comment
Squid Posted December 17, 2020 Author Share Posted December 17, 2020 These are the only 3 that have ever come with the plugin. You've added it at some point. Removing and reinstalling the plugin doesn't ever clean up any other existing scripts 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.