ProphetSe7en Posted February 11, 2022 Share Posted February 11, 2022 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 Quote Link to comment
VACInc Posted February 13, 2022 Share Posted February 13, 2022 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. Quote Link to comment
Squid Posted February 14, 2022 Author Share Posted February 14, 2022 Stopping happens before (while the services at being stopped). Starting happens after the disks are mounted 1 Quote Link to comment
der8ertl Posted February 14, 2022 Share Posted February 14, 2022 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! Quote Link to comment
Squid Posted February 14, 2022 Author Share Posted February 14, 2022 There's no error checking at all on the custom entry, so whatever you use should get automatically added. Quote Link to comment
der8ertl Posted February 14, 2022 Share Posted February 14, 2022 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? Quote Link to comment
der8ertl Posted February 14, 2022 Share Posted February 14, 2022 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! Quote Link to comment
sjoerd Posted February 27, 2022 Share Posted February 27, 2022 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? Quote Link to comment
prymordial Posted March 2, 2022 Share Posted March 2, 2022 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 Quote Link to comment
Falcom Posted March 4, 2022 Share Posted March 4, 2022 Hello How schedule it is working? it doesn't work for me Quote Link to comment
Squid Posted March 4, 2022 Author Share Posted March 4, 2022 48 18 is not a valid cron expression https://crontab.guru/ Quote Link to comment
Falcom Posted March 4, 2022 Share Posted March 4, 2022 (edited) its minute 48 and hour 18 Ok miss the stars thanks Edited March 4, 2022 by Falcom Quote Link to comment
Squid Posted March 4, 2022 Author Share Posted March 4, 2022 And you forgot about day of month, month, and day of week. Or in your case, * * * Quote Link to comment
wgstarks Posted March 4, 2022 Share Posted March 4, 2022 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 * * * Quote Link to comment
xxnumbxx Posted March 6, 2022 Share Posted March 6, 2022 (edited) 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, 2022 by xxnumbxx Quote Link to comment
Squid Posted March 6, 2022 Author Share Posted March 6, 2022 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 Quote Link to comment
xxnumbxx Posted March 9, 2022 Share Posted March 9, 2022 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. Quote Link to comment
bthoven Posted March 9, 2022 Share Posted March 9, 2022 (edited) 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, 2022 by bthoven to add solution Quote Link to comment
Squid Posted March 10, 2022 Author Share Posted March 10, 2022 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 Quote Link to comment
nraygun Posted March 10, 2022 Share Posted March 10, 2022 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? Quote Link to comment
Squid Posted March 10, 2022 Author Share Posted March 10, 2022 Unfortunately, no. User scripts leverages the built-in dynamix log viewer, so it's limited by it's display constraints. Quote Link to comment
dalben Posted March 10, 2022 Share Posted March 10, 2022 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? Quote Link to comment
JonathanM Posted March 11, 2022 Share Posted March 11, 2022 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? 1 Quote Link to comment
dalben Posted March 11, 2022 Share Posted March 11, 2022 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 Quote Link to comment
batesman73 Posted March 15, 2022 Share Posted March 15, 2022 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 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.