February 11, 20224 yr 7 hours ago, Squid said: Everything echo'd from your script is what constitutes the log I see. Is it possible to get the same info that I would get by running the command in terminal? I am running a jdupe command, and would like to be able to see how far in the process it has come from looking at the logs
February 13, 20224 yr Is "At stopping of array" in User Scripts occur before, during, or after the array is stopping? Same question with ""at start of array". I would like to setup my unraid to switch on/off my JBOD (via APC control) that are all the UNRAID disks before/after UNRAID starts, but not sure it will work in the correct order to function properly.
February 14, 20224 yr Author Stopping happens before (while the services at being stopped). Starting happens after the disks are mounted
February 14, 20224 yr On 2/10/2022 at 2:05 PM, Squid said: Instead of 2-31 and 0-4,6 use 2,3,4,5 .... and 0,1,2,3,4,6 Hi again, so, it took me a while, but unfortunately it does not work.. is that cron setting general to complicated, to long, or can there be something wrong on my system? can I provide any additional information for analysis? thanks in advance!
February 14, 20224 yr Author There's no error checking at all on the custom entry, so whatever you use should get automatically added.
February 14, 20224 yr ok what now? does that mean, i cannot use this? neither 0 1 2-31 * 0-4,6 nor 0 1 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 * 0,1,2,3,4,6 is working but i really would like to exclude fridays (backups of some vms from a different host roll in) and the first day of the month (monthly parity check) with this setting. any other suggestions?
February 14, 20224 yr hmm.. can i check this within the script? so that it runs daily, but if it sees its friday, or first day of the month, then exit? I'm not an expert, I've just copied @mgutt's backup-script (thank you!) and changed it a little thanks in advance!
February 27, 20224 yr Is it possible to source in other files (with functions and/or presetted variables) into the main "script". I'm tinkering with a script and would like a lot of functions to be in a different file to reduce the size of the actual script and keep the main-script clean and tidy. I noticed scripts that are running have their script copied to /tmp/user.scripts/tmpScripts. Will that affect sourcing in files difficult?
March 2, 20224 yr Just installed the plugin! Thanks a lot Squid. One thing I wanted to call out was that the "What is Cron" link in the top left is linked to a dead webpage - it directs you to https://corntab.com instead of https://crontab.com. Additionally, crontab.com seems to be deprecated as well and the closest page I was able to find is https://crontab.guru. Hope this helps
March 4, 20224 yr its minute 48 and hour 18 Ok miss the stars thanks Edited March 4, 20224 yr by Falcom
March 4, 20224 yr Author And you forgot about day of month, month, and day of week. Or in your case, * * *
March 4, 20224 yr 26 minutes ago, Falcom said: Hello How schedule it is working? it doesn't work for me Looks like you’re missing the asterisks. 48 18 * * *
March 6, 20224 yr Users scripts not persistent on reboot. How to I get the script to run afte reboot? It works fine when I first apply the script but it will not run unless manually triggered after reboot. I have set to custom */1 * * * *. I also tried * * * * * edit: It looks like user-scripts doesn't execute until the array is started. Anyway to do this regardless of array state? Edited March 6, 20224 yr by xxnumbxx
March 6, 20224 yr Author 1 hour ago, xxnumbxx said: edit: It looks like user-scripts doesn't execute until the array is started. Anyway to do this regardless of array state? No. Not because it's not an easy thing to do, but mainly because I don't want to deal with the inevitable support requests caused by that. Edit the "go" file (/config/go on the flash drive) to accomplish this
March 9, 20224 yr On 3/6/2022 at 4:55 PM, Squid said: No. Not because it's not an easy thing to do, but mainly because I don't want to deal with the inevitable support requests caused by that. Edit the "go" file (/config/go on the flash drive) to accomplish this Fair enough. Thank you.
March 9, 20224 yr I'm not sure this is the right place to post my question because I can't create a new topic under the application support/plugins section. I've created 2 user scripts, say script A and B, under CA User Scripts plugin. Script B is supposed to be called by several scripts with passing arguments. In this case, Script A will call script B and also pass 4 arguments to B. I know how to do it under native Debian bash script, but I don't know how to acheive this under CA User Scripts plugin. Would appreciate any guidance. update: I found the solution, to call other script defined in CA User Script, e.g. to call script named "subscriptB": sh /boot/config/plugins/user.scripts/scripts/subscriptB/script arg1 arg2 arg3 ..... Edited March 9, 20224 yr by bthoven to add solution
March 10, 20224 yr Author 19 hours ago, bthoven said: update: I found the solution, to call other script defined in CA User Script, e.g. to call script named "subscriptB": sh /boot/config/plugins/user.scripts/scripts/subscriptB/script arg1 arg2 arg3 ..... Yeah, nothing on the flash drive is directly executable, so the sh (or /bin/bash) is required
March 10, 20224 yr I'm using the CA User Scripts plugin with some scripts that are scheduled to run in the background. Works great for my backup script. There's a "Show log" button for the script, but it only shows the last 41 lines or so from the log. I know I can go into the full log at /tmp/user.scripts/tmpScripts/scriptname/log.txt, but is there a way to lengthen the number of lines that the "Show log" button shows?
March 10, 20224 yr Author Unfortunately, no. User scripts leverages the built-in dynamix log viewer, so it's limited by it's display constraints.
March 10, 20224 yr Only just started to really use this plugin and dropped adding scripts to crontab. Kicking myself for not migrating to this earlier. Quick question. I have a need to add an entry to the hosts file of about 3 dockers after they start up (a server i am trying to reach has had it's domain name snatched so a hosts file entry is the only way to get to it). Is there a way I can trigger CAUS to to run a script upon docker start? Or maybe 5/10 mins after array start? While I am at it, any tips on writing a script that can be run from the console to had hosts entries in docker containers? Or is there a simpler way to do it?
March 11, 20224 yr 1 hour ago, dalben said: Is there a way I can trigger CAUS to to run a script upon docker start? Reverse your logic and it's pretty easy. echo "_waiting 5 minutes" sleep 300 echo "_starting Container X" /usr/bin/docker start (container X) echo "_starting Container Y" /usr/bin/docker start (container Y) echo "_starting Container Z" /usr/bin/docker start (container Z) echo "_modifying hosts" ?command to add hosts entry? Disable auto start for the containers, set the script to start at array start, it waits 5 minutes, starts the container(s), then does your hosts thing. 1 hour ago, dalben said: While I am at it, any tips on writing a script that can be run from the console to had hosts entries in docker containers? Sorry, no help there. Why does it have to be limited to those containers, and why only after start? Couldn't you just do the magic in your router, or in Unraid itself?
March 11, 20224 yr 7 hours ago, JonathanM said: Reverse your logic and it's pretty easy. Thanks, that makes sense. 7 hours ago, JonathanM said: Couldn't you just do the magic in your router, or in Unraid itself? Didn't think of that, but yes, I'll try the Unraid way first. Makes life a lot easier
March 15, 20224 yr Hi, after upgrading to 6.10-rc3 I can't edit scripts any more via the WebIF. Even though i create a new one I could only enter the name of the script but no "content". Does anybody know about it ? The scripts themselves are still existing and I can edit via ssh/nano. HTX
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.