Sarge888 Posted September 18, 2023 Share Posted September 18, 2023 So I have a simple script that runs a curl command within a docker container using docker exec command. However the output I get is just a download progress before finishing. It works just fine however I'd like the output to show me the returned json from the api call. Running the same command in a shell shows me the response. So I'm wondering how to have the userscript also return the response instead of just showing a download. Quote Link to comment
KnifeFed Posted September 19, 2023 Share Posted September 19, 2023 3 hours ago, Sarge888 said: So I have a simple script that runs a curl command within a docker container using docker exec command. However the output I get is just a download progress before finishing. It works just fine however I'd like the output to show me the returned json from the api call. Running the same command in a shell shows me the response. So I'm wondering how to have the userscript also return the response instead of just showing a download. docker exec <container> curl -s <url> Quote Link to comment
Sarge888 Posted September 19, 2023 Share Posted September 19, 2023 1 hour ago, KnifeFed said: docker exec <container> curl -s <url> That gets rid of the progress bar but does not show me the result. I should be recieving a api json response. Is there anyway to see that response in the output window? Quote Link to comment
KnifeFed Posted September 19, 2023 Share Posted September 19, 2023 8 hours ago, Sarge888 said: That gets rid of the progress bar but does not show me the result. I should be recieving a api json response. Is there anyway to see that response in the output window? I just created a new script with: #!/bin/bash docker exec binhex-krusader curl -s https://jsonplaceholder.typicode.com/todos/1 And I get the output: { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } Does that not work for you? Quote Link to comment
Sarge888 Posted September 21, 2023 Share Posted September 21, 2023 On 9/19/2023 at 7:18 AM, KnifeFed said: I just created a new script with: #!/bin/bash docker exec binhex-krusader curl -s https://jsonplaceholder.typicode.com/todos/1 And I get the output: { "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false } Does that not work for you? Yes that does work for me. I guess it's the curl command I'm using. It uses both the -b and -c variables which I now understand is why it's downloading something. But why it doesn't tell me the response like it does wen I run the command in the shell is beyond me. I'd share the command but it relates to a tracker site and I'm not sure if that's allowed here. Quote Link to comment
troubledraider Posted September 29, 2023 Share Posted September 29, 2023 Is it possible to implement a kill/stop button next to each script in the event a running or stalled script needs to be stopped? Quote Link to comment
unr41dus3r Posted October 2, 2023 Share Posted October 2, 2023 Feature Request: Show the Time and Date when a default time frame is chosen. "Daily" Every Day @ 00:01 "Weekly" Every Sunday @ 00:00 and so on. At the moment i dont know which time frame is set. Show the information where you would put the custom cron for example. 1 Quote Link to comment
Mave Posted October 5, 2023 Share Posted October 5, 2023 Hello, First of all I love this plugin, thanks for all your hard work! Second: I'm having a small problem: there is a script running, but I can't seem to abort it. I already tried to abort it, yet it's still running and the "abort" button is missing. How can I stop the script? (When I click the log, I can see the script is still running, it's still uploading files to my remote) Quote Link to comment
s449 Posted October 5, 2023 Share Posted October 5, 2023 I just started using a script with the cron schedule 0 2 * * * (every day at 2am). Looking at my Pushover logs it happened at 5am. My best guess is I recently moved from PST time to EST time and 2am PST would be 5am EST. Going to /Settings/DateTime on my Unraid dashboard does say I'm in Eastern Time, however. Is it possible the plugin is still stuck on the old timezone? Thank you! Quote Link to comment
Mave Posted October 6, 2023 Share Posted October 6, 2023 19 hours ago, Mave said: Hello, First of all I love this plugin, thanks for all your hard work! Second: I'm having a small problem: there is a script running, but I can't seem to abort it. I already tried to abort it, yet it's still running and the "abort" button is missing. How can I stop the script? (When I click the log, I can see the script is still running, it's still uploading files to my remote) I ended up rebooting, but surely there must be a better solution? Quote Link to comment
jit-010101 Posted October 9, 2023 Share Posted October 9, 2023 (edited) At Startup of Array and At Fist Start of Array Only are not working for me on two machines with 6.12.4 If you use either - then trying to run a script in background it simply wont do anything. For example try to do a simple echo "hello world" 1> /var/log/hello.log in a new script and then a cat /var/log/hello.log in the terminal afterwards - either by trying to run in background, or via array start -> nothing produced. You have to actually run the user-script manually in foreground - otherwise it wont work. I recon this has something to do with scheduling? Happens for me on two systems - both on 6.12.4 ... one of that brand new, and with very little plugins at all beside user scripts. No clue maybe its just me or I'm missing something very basic but both dont seem to do anything at all ... even on freshly created scripts of any name. I since then moved to add this to my /boot/config/go ... works just fine (albeit before the array starts) # wait 30 seconds then enable the crond jobs ... /bin/bash -c 'sleep 30; /usr/bin/resticprofile --log /var/log/resticprofile schedule --all' & Edit forgot to mention: If I run the same script for example with a custom scheduler every 5 minutes it works just fine. Edited October 9, 2023 by jit-010101 Quote Link to comment
Squid Posted October 9, 2023 Author Share Posted October 9, 2023 Array start and first array start works perfectly for me. This is something I would notice very quickly due to my workflow. Array start on my end is simply 3 beeps so I know everything is good to go. First array start sets up a symlink that I couldn't live without to do any dev work. Quote Link to comment
jit-010101 Posted October 10, 2023 Share Posted October 10, 2023 (edited) 10 hours ago, Squid said: Array start and first array start works perfectly for me. This is something I would notice very quickly due to my workflow. Array start on my end is simply 3 beeps so I know everything is good to go. First array start sets up a symlink that I couldn't live without to do any dev work. I guessed as much ... how do you spawn the shell and should it create a log-file (if not could you add that - same as for cronjobs)? I wonder what's preventing it from writing to log files and crontab ... seems almost like its a permission error or something Edited October 10, 2023 by jit-010101 Quote Link to comment
Sanjiv Patel Posted October 12, 2023 Share Posted October 12, 2023 (edited) Hi, I have the latest version of the plugin 2023.09.30, I noticed my script stopped running on the 25th of September. I can run through the GUI just fine or through the shell. I have tried setting the script to run daily or hourly, but it won't invoke it automatically. Any ideas, I can try to get things running again? -rw------- 1 root root 3012 Oct 12 11:24 script bash /boot/config/plugins/user.scripts/scripts/gphoto-sync/script Edited October 12, 2023 by Sanjiv Patel Quote Link to comment
Valkyrie Posted October 14, 2023 Share Posted October 14, 2023 (edited) Hello, I get the following error when trying to add a backed enum (https://www.php.net/manual/en/language.enumerations.backed.php). Does anyone have any idea why? They should be supported from php version 8.1 and my /usr/bin/php is 8.2.7 Edited October 14, 2023 by Valkyrie Quote Link to comment
Lonewolf147 Posted October 14, 2023 Share Posted October 14, 2023 Question - I have a script that monitors my CPU temp. I have a command built in to have it 'run' once a minute. The script runs just fine, my question is if I set it to run on Array Start, will it automatically be terminated when the array is stopped? If not, is there some command I can add to the script to check the status of the array and to kill the script if the array is stopped? Quote Link to comment
alturismo Posted October 15, 2023 Share Posted October 15, 2023 20 hours ago, Lonewolf147 said: my question is if I set it to run on Array Start, will it automatically be terminated when the array is stopped? depends if there is something in the script which relys on the array ... lets say you have a binary which you are executing which is on the array, so when the array is stopped it wont run any further as it fails ... or, if the script is a "always runner" ... then it will stop once the array is stopped ... sample 20 hours ago, Lonewolf147 said: If not, is there some command I can add to the script to check the status of the array and to kill the script if the array is stopped? there sure is ... depends now on the upper case ... simple a file exist on your array ... simple if / else rule --- if yes do you job ... if no ... exit out ... idk your script now but you will figure it FILE=/mnt/cache/system/check_array_file if [ -f "$FILE" ]; then echo "$FILE exists." else echo "$FILE does not exist." fi 1 Quote Link to comment
Mave Posted October 18, 2023 Share Posted October 18, 2023 On 10/6/2023 at 10:56 AM, Mave said: I ended up rebooting, but surely there must be a better solution? Anyone please? Quote Link to comment
vincca Posted October 18, 2023 Share Posted October 18, 2023 Hopefully this is an easy one. When I run rclone mount from userscripts it doesn't seem to honor the --allow-other If I run the same rclone mount from terminal it gives the proper permissions. Example: using userscripts Using terminal Quote Link to comment
nearcatch Posted October 22, 2023 Share Posted October 22, 2023 On 10/9/2023 at 2:37 PM, jit-010101 said: At Startup of Array and At Fist Start of Array Only are not working for me on two machines with 6.12.4 If you use either - then trying to run a script in background it simply wont do anything. For example try to do a simple echo "hello world" 1> /var/log/hello.log in a new script and then a cat /var/log/hello.log in the terminal afterwards - either by trying to run in background, or via array start -> nothing produced. You have to actually run the user-script manually in foreground - otherwise it wont work. I recon this has something to do with scheduling? Happens for me on two systems - both on 6.12.4 ... one of that brand new, and with very little plugins at all beside user scripts. No clue maybe its just me or I'm missing something very basic but both dont seem to do anything at all ... even on freshly created scripts of any name. I since then moved to add this to my /boot/config/go ... works just fine (albeit before the array starts) # wait 30 seconds then enable the crond jobs ... /bin/bash -c 'sleep 30; /usr/bin/resticprofile --log /var/log/resticprofile schedule --all' & Edit forgot to mention: If I run the same script for example with a custom scheduler every 5 minutes it works just fine. Did you ever find a fix for this? I'm finding today that "on array start" scripts aren't running for me either. I'm not sure when the issue started since I don't often reboot my server, but I'm also on 6.12.4. Quote Link to comment
alturismo Posted October 22, 2023 Share Posted October 22, 2023 4 hours ago, hasown said: I'm not sure when the issue started since I don't often reboot my server, but I'm also on 6.12.4. actually personally i cant confirm this, here i also user scripts on array start and they sure work samples which i would directly be aware off if not ... also on 6.12.4 did you check your logs if there are any fails ? Quote Link to comment
robw83 Posted October 22, 2023 Share Posted October 22, 2023 On 10/2/2023 at 8:24 AM, unr41dus3r said: Feature Request: Show the Time and Date when a default time frame is chosen. "Daily" Every Day @ 00:01 "Weekly" Every Sunday @ 00:00 and so on. At the moment i dont know which time frame is set. Show the information where you would put the custom cron for example. Putting in my vote for this request. Do all daily/weekly/monthly scripts initiate at the same time? Id like to have a little bit more granularity here. Quote Link to comment
itimpi Posted October 22, 2023 Share Posted October 22, 2023 11 minutes ago, robw83 said: Putting in my vote for this request. Do all daily/weekly/monthly scripts initiate at the same time? Id like to have a little bit more granularity here. As far as I know they do. You can control the start times to be exactly when you want using the Custom option. Quote Link to comment
Steviewunda Posted October 26, 2023 Share Posted October 26, 2023 Where do I find "/tmp/user.scripts/tmpScripts/Backup" in order to view my rsync logs? Sorry to ask such a basic question, but I have searched the unRaid forums without an answer 1 Quote Link to comment
alturismo Posted October 26, 2023 Share Posted October 26, 2023 1 hour ago, Steviewunda said: Where do I find "/tmp/user.scripts/tmpScripts/Backup" in order to view my rsync logs? you should see your logs on the user scripts page if you manually want to copy them over they are located in Ram ... so a cp ..../log.txt /mnt/user/whereever ... will copy them to a persistent storage. 1 1 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.