Squid Posted January 1, 2021 Author Share Posted January 1, 2021 3 minutes ago, HarryD said: My issue is that i have a script i need to run scheduled in the background test.sh. If i run the scripts from the userscripts page with the "run script" button it works with no issue. However when i click "run in background" the script does not run, i have deleted the plugin and deleted it from the drive also, then reinstalled. I have a second unraid server with an identical script that runs flawlessly and now even the default scripts do not action. below is the server log when i click "run script" and nothing happens Jan 2 04:50:20 Email emhttpd: cmd: /usr/local/emhttp/plugins/user.scripts/backgroundScript.sh /tmp/user.scripts/tmpScripts/test/script any help would be greatly appreciated. Any punctuation in the description? Quote Link to comment
HarryD Posted January 1, 2021 Share Posted January 1, 2021 3 minutes ago, Squid said: Any punctuation in the description? i might miss-understand what you're saying? sorry if my original post was not clear. When i attempt to run the script in the image below, clicking the "Run in background" button, nothing happens. script is identical to the one i use on another unraid server without issues. however even the default scripts that come with the 'userscripts' plugin do not run in background. Quote Link to comment
Squid Posted January 1, 2021 Author Share Posted January 1, 2021 Give me a screenshot then of the entire page Quote Link to comment
HarryD Posted January 1, 2021 Share Posted January 1, 2021 (edited) 3 minutes ago, Squid said: Give me a screenshot then of the entire page full page screenshot, brings up "script running window" as normal but script does not actually run in background and doesn't bring up the usual "running" Edited January 1, 2021 by HarryD Quote Link to comment
sdfyjert Posted January 6, 2021 Share Posted January 6, 2021 (edited) I am trying to run some command and push them the in background but the GUI terminal seems to get stuck and the script doesn't really seem to finish (I do not see the echo in the window and running ps aux | grep avahi-publish show the process does not exist). Any suggestions? #!/bin/bash #description=Generate avahi aliases #foregroundOnly=true #name=Avahi aliases (sub-domains) echo "plex.inas.local" /usr/bin/avahi-publish -a -R plex.inas.local $(avahi-resolve -4 -n inas.local | cut -f 2) & Edited January 6, 2021 by sdfyjert Quote Link to comment
Squid Posted January 6, 2021 Author Share Posted January 6, 2021 I would try the "at" command (at NOW -m IIRC) to start your process Quote Link to comment
kizer Posted January 6, 2021 Share Posted January 6, 2021 On 1/1/2021 at 1:33 PM, HarryD said: full page screenshot, brings up "script running window" as normal but script does not actually run in background and doesn't bring up the usual "running" From what I remember that's normal. Otherwise there would be an error saying. If you close this box it will shut down the script. Simply click the close button it will continue running in the background. Quote Link to comment
nuhll Posted January 6, 2021 Share Posted January 6, 2021 Is there a easy way to pause all scripts? (if not i suggest a pause unpause button switch) Quote Link to comment
Fffrank Posted January 6, 2021 Share Posted January 6, 2021 Trying to run a script that deletes all folders under a certain size (which works perfectly) but I need to exclude 1 folder and I can't get the syntax right. Help? #!/bin/bash shopt -s extglob du /mnt/user/media/Movies/ | awk '$1 <= 300000 { print "rm -rf -v \"" substr($0, length($1)+2) "\" !(".stfolder")"}' | sh awk: cmd. line:1: $1 <= 300000 { print "rm -rf -v \"" substr($0, length($1)+2) "\" !(".stfolder")"} awk: cmd. line:1: ^ syntax error Quote Link to comment
Fffrank Posted January 6, 2021 Share Posted January 6, 2021 5 hours ago, Fffrank said: Trying to run a script that deletes all folders under a certain size (which works perfectly) but I need to exclude 1 folder and I can't get the syntax right. Help? #!/bin/bash shopt -s extglob du /mnt/user/media/Movies/ | awk '$1 <= 300000 { print "rm -rf -v \"" substr($0, length($1)+2) "\" !(".stfolder")"}' | sh awk: cmd. line:1: $1 <= 300000 { print "rm -rf -v \"" substr($0, length($1)+2) "\" !(".stfolder")"} awk: cmd. line:1: ^ syntax error Solved my own problem and wanted to post the solution. I added the if statement for exclusion to the awk routine rather than asking asking the rm command to ignore. du /mnt/user/media/Movies/ | awk '{ if ( $1 <= 300000 && $2 != "/mnt/user/media/Movies/.stfolder" ) print "rm -rf -v \"" substr($0, length($1)+2) "\"" }' | sh Quote Link to comment
Lonnie LeMaster Posted January 17, 2021 Share Posted January 17, 2021 Is there a way to schedule a script to run at the conclusion of another? Quote Link to comment
Aerodb Posted January 18, 2021 Share Posted January 18, 2021 So, I'm having some issues with a docker... those issues aside, I'm looking for a script to schedule a docker reboot regularly, such as every 2 hours or so. I have been working to resolve the core issue but thus far, the only resolution I have found is to restart the problem docker. anyone have a script that can accomplish this? Quote Link to comment
JonathanM Posted January 18, 2021 Share Posted January 18, 2021 2 hours ago, Aerodb said: I'm looking for a script to schedule a docker reboot regularly, such as every 2 hours or so. https://forums.unraid.net/topic/44140-support-binhex-nzbget/?do=findComment&comment=834897 Adapt as needed. 1 Quote Link to comment
comet424 Posted January 20, 2021 Share Posted January 20, 2021 (edited) how do you organize the Scripts i tried renaming so the Scripts would resort alphabetical as i got 20 scripts i trying to clean up but i want to sort them like group them (computer1) does that script (computer1) does this script (computer 2 does this script) (computer 3) or is there a text file named "order" that shows the order of scripts so i can manually move them around to organize the scripts properly group them and how do you get it when you Change the user script name.. that it will change the actual File name too.. it doesnt do that.. it keeps the old script name also be nice to sort by Custom, Daily, Monthly and also sort by Custom + File name Daily + Filename Monthy + Filename or have Breaks ------------------- between sets Daily script 1 script 2 ------------------------ Monthly script 3 script 4 -------------------------------- Daily script 5 script 6 Edited January 20, 2021 by comet424 Quote Link to comment
comet424 Posted January 20, 2021 Share Posted January 20, 2021 also is the dangling images script id is depreciated? it doesnt work .. i tried different wayts #docker rmi $(docker images --quiet --filter "dangling=true") #docker rmi $(docker images -q -f dangling=true) docker rmi $(docker images -f dangling=true -q) if you run the command line docker rmi --help there is no -q -f or dangling as options so is that script depreciated Quote Link to comment
Acu Posted February 5, 2021 Share Posted February 5, 2021 Hi i have a problem with the plugin user script. I used diacritics for some names. And now I can't remove these scripts and I can't set the cron function. Even after reinstallation, these scripts always appear there and cannot be deleted. Is it possible to reset this plugin to factory settings? Quote Link to comment
Acu Posted February 5, 2021 Share Posted February 5, 2021 14 minutes ago, Acu said: Hi i have a problem with the plugin user script. I used diacritics for some names. And now I can't remove these scripts and I can't set the cron function. Even after reinstallation, these scripts always appear there and cannot be deleted. Is it possible to reset this plugin to factory settings? So I've figured it out just to rename the folder on the flash drive. user.scripts.old I couldn't delete it, but after renaming all the scripts disappeared. Quote Link to comment
Squid Posted February 5, 2021 Author Share Posted February 5, 2021 You want to rename the folders within /config/plugins/user.scripts/scripts Quote Link to comment
TexasUnraid Posted February 10, 2021 Share Posted February 10, 2021 Does anyone know of a way to setup a button in the GUI to 1-click run a script? Custom Tabs does not seem to support this but something along those lines is what I am looking for. Looking for a way to easily switch between power saving mode (which the server stays in 95% of the time) and performance (only when having it render or do something intensive). Also be nice for some other uses as well such as a sync script I have, or snapshots etc Quote Link to comment
Energen Posted February 11, 2021 Share Posted February 11, 2021 On 2/10/2021 at 7:51 AM, TexasUnraid said: Does anyone know of a way to setup a button in the GUI to 1-click run a script? Custom Tabs does not seem to support this but something along those lines is what I am looking for. Looking for a way to easily switch between power saving mode (which the server stays in 95% of the time) and performance (only when having it render or do something intensive). Also be nice for some other uses as well such as a sync script I have, or snapshots etc Don't know if this is a starting point but you'd have to 1) implement your button into the GUI initially for testing, and 2) make it so that it is recreated upon reboot... then you may be able to get some ideas here https://stackoverflow.com/questions/44443164/execute-a-shell-script-from-html Quote Link to comment
TexasUnraid Posted February 11, 2021 Share Posted February 11, 2021 (edited) 10 minutes ago, Energen said: Don't know if this is a starting point but you'd have to 1) implement your button into the GUI initially for testing, and 2) make it so that it is recreated upon reboot... then you may be able to get some ideas here https://stackoverflow.com/questions/44443164/execute-a-shell-script-from-html Thanks, I was looking for something more integrated into unraid. Customtabs would work great if it had the option to run a script / command. Don't really want to do anything custom to the OS unless I have to. I was hoping there was a plug-in that could do this that I had not heard of. Kinda surprised that nothing exsists to be honest, seems like something someone would of wanted in all these years. Edited February 11, 2021 by TexasUnraid Quote Link to comment
Mogo Posted February 13, 2021 Share Posted February 13, 2021 Hi, I'm trying to add a script, however I cannot create the folder in config/plugins/user.scripts/scripts. I get a "Destination Folder Access Denied" error. Any ideas on how to fix this? Also just a coding question. I'm trying to write a python script to list directories using pycharm in a docker. If i run the following commands these are the outputs: - "pwd" returns "/home/nobody/PychamProjects/test" (above command works) - "ls -l ../mnt/cache/appdata" returns "No such file or directory" (what should be the correct path? typing that command in the unraid terminal gives a directory listing) Quote Link to comment
Energen Posted February 13, 2021 Share Posted February 13, 2021 1 hour ago, Mogo said: Hi, I'm trying to add a script, however I cannot create the folder in config/plugins/user.scripts/scripts. I get a "Destination Folder Access Denied" error. Any ideas on how to fix this? Also just a coding question. I'm trying to write a python script to list directories using pycharm in a docker. If i run the following commands these are the outputs: - "pwd" returns "/home/nobody/PychamProjects/test" (above command works) - "ls -l ../mnt/cache/appdata" returns "No such file or directory" (what should be the correct path? typing that command in the unraid terminal gives a directory listing) Docker containers are separate from the host OS meaning that a docker container has no knowledge of /mnt/cache/appdata -- it does not exist because it cannot access Unraid's filesystem. Quote Link to comment
Squid Posted February 14, 2021 Author Share Posted February 14, 2021 8 hours ago, Mogo said: Hi, I'm trying to add a script, however I cannot create the folder in config/plugins/user.scripts/scripts. I get a "Destination Folder Access Denied" error. Any ideas on how to fix this? Where are you seeing this? Quote Link to comment
Mogo Posted February 14, 2021 Share Posted February 14, 2021 (edited) It was on the windows machine when you browse using file explorer to create a folder on the unraid system. I figured out what the issue was. For some reason the smb security settings was set to secure (for the usb flash drive) which prevents write access. I changed it to public and it allows me to create the folder now. I guess i have to live with that warning beside the usb flash drive saying to change it. Edited February 14, 2021 by Mogo 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.