November 10, 20241 yr I can't seem to get this plugin working at all. I've added a script which works fine when I click the run script button, however when setting a custom schedule it doesn't run at the selected time (for testing I picked 40 20 * * * as it was a few minutes in the future). There's no entry for it in the crontab either, so not sure what I'm doing wrong here.
November 10, 20241 yr Did you press the "Apply" button at the bottom left of the screen? I can't recall how many times I have forgotten to do this.
November 14, 20241 yr On 11/10/2024 at 5:03 AM, ConnerVT said: Did you press the "Apply" button at the bottom left of the screen? I can't recall how many times I have forgotten to do this. Yeah I've hit apply.
November 14, 20241 yr On 11/9/2024 at 10:42 AM, alturismo said: Hi @Squid, may a hint why user scripts have issues with umlauts when running in background ok, seems i figured it LC... locales, when running in background there no locales defined, so i defined them like the regular shell and its looking good now. export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8
November 15, 20241 yr Hi guys, I've been using CA User Scripts on Unraid to run Restic backups, but I've encountered a persistent issue: when I abort a script (using the "Abort Script" button), the Restic process continues running in the background. I have tried implementing process cleanup using trap and commands like kill 0 or pkill -TERM -P $$ to terminate all child processes, but it doesn't seem to work for Restic. Here is my script (simplified for readability): #!/bin/bash trap cleanup SIGINT SIGTERM cleanup() { echo "Cleaning up..." pkill -TERM -P $$ 2>/dev/null kill 0 2>/dev/null } # Main logic to run Restic restic backup /path/to/backup & wait Even with this setup, the Restic process remains active after I abort the script. This forces me to manually log into the terminal and kill the Restic process, which is less than ideal. Questions: Is there something I'm doing wrong in the script that prevents proper cleanup of Restic processes? Are there known issues with CA User Scripts or Restic in background mode that might cause this behavior? Is there a better approach to ensure all subprocesses (including Restic) are terminated on script abort? Any help or insights would be greatly appreciated. Thanks!
November 24, 20241 yr On 3/15/2023 at 8:56 AM, dayvight said: I have a problem about 502 bad gateway when i run script or run in backgroud.I tried to reinstall the plugin to no avail. Heya, did you ever find a solution for this? I'm currently experiencing the same issue but I couldn't see a reply by anyone to your post? Thanks
December 2, 20241 yr @Squid can you add an option to change the order of the scripts? also it would be nice to be able to see which scripts are enable (via cron or running) and which aren't, like a green circle or something, it's just a visual aid Edited December 2, 20241 yr by L0rdRaiden
December 3, 20241 yr This is how I normally (quickly) verify which are active: Active scripts show those icons on the right. Disabled ones have no icons.
December 9, 20241 yr I accidentally named a script with a % sign in the title and I am unable to edit or remove the script. How can I rename or remove it so I can add it again without the % sign? Edit: I was able to locate the scripts here: cd /boot/config/plugins/user.scripts/scripts/ I then deleted the problem folder and refreshed the user script plugin and everything works as normal now. Edited December 9, 20241 yr by Android_18
December 15, 20241 yr Hello guys, could you please help me? I need a script, that moves the unsorted files from the folder /mnt/user/Pictures/unsorted to an folder structure A to Z and 0, based on the first letter of the filename. example: /mnt/user/Pictures/unsorted/Austria-vacation_001.jpg would be moved to: /mnt/user/Pictures/sorted/A/Austria-vacation_001.jpg /mnt/user/Pictures/unsorted/Spain_001.jpg would be moved to: /mnt/user/Pictures/sorted/S/Spain_001.jpg I would like to start this script manually, whenever i have a few of "unsorted" Files. Thanks a lot in advance! I have figured it out by myself, if anybody needs it: #!/bin/bash target=/mnt/user/Pictures/sorted/ for f in /mnt/user/Pictures/unsorted/* ; do if [[ -f "$f" ]]; then i=${f##*/} i=${i:0:1} dir=${i^} if [[ $dir != [A-Z] ]]; then mkdir -p "${target}/0-9" && mv "$f" "${target}/0-9" else mkdir -p "${target}/$dir" && mv "$f" "${target}/$dir" fi fi done Edited December 20, 20241 yr by ladidaaa solution
December 16, 20241 yr Hello, I named my script : Exctinction manuelle (Changer le delais !) ... but I don't think it likes exclamation marks or brackets. When I click on the wheel on the left, nothing happens. I don't have any problems with my other script names that don't contain any special characters.
December 16, 20241 yr Author 3 minutes ago, Alex.b said: exclamation marks Probably the exclamation point immediately followed by the bracket. Putting in a space between the two might fix
December 18, 20241 yr Hello, I just have a request, if possible. When using the "ADD NEW SCRIPT" button, if there is a space at the end of the script name, it won't create it. I was copy/pasting a name and it had a extra space at the end. It took me a good amount of time to realize that was the issue. I can remember this going forward, but for others & new users, is it possible to remove any spaces at the end of the script name after input or pressing "OK" so there's no confusion?
December 18, 20241 yr Hmm. Is it possible to put other illegal characters in there? That's a bug either way.
December 19, 20241 yr On 9/14/2024 at 5:32 AM, Daburgers said: Managed to fix the issue: The issue was that the system time in unraid was incorrect - even though I had manually set it correctly. I noticed my server was actually powering down, but not at the right time. So that made me think it had to be my date & time settings. So I checked them again for the 4th time, and this is when I noticed the issue. Although they were set correctly, for some strange reason the "New date & time" at the bottom of the settings was not correct. So I decided to use NTP servers to see if that made any difference....and it did. The time adjusted correctly. I tested out my script again with a new schedule and BOOM - it worked. Attached is an image of my settings before and after I made the changes in case it helps someone else: I have the same issue but my time is fine and i have been trying different NTP and this still happens for me on Unraid 7 rc1.
January 3, 20251 yr I seem to be unable to copy a folder into the user.scripts/scripts folder on my flash. Is this intentional? Let's say I've setup a user script on unraid and want to copy the script's folder to use the same on another; how am I expected to carry this out? I can't see how to get files to cross the flash/array barrier. It feels like I have to use the UI to make the script, then just edit (copy/paste) into the files that user.scripts plugin made for me, but I feel like I should be able to drop a folder in and make use of it. Is this not the case? Am I crazy, missing something? Edit: From the future... I wound up just creating the script again on the second unRAID server. I feel like there was another time I was attempting to copy something else between the flash and a share and I couldn't get it, had to copy to another share first, perhaps. I don't remember. I forget what or why by now, though. I'll circle back if I run into it again... Edited March 27, 20251 yr by It's just J.
January 3, 20251 yr Did you try rebooting after adding them? A lot of stuff from the flash is only loaded at boot. If that doesn't help then it's probably that it's using schedule.json as a list of existing scripts and that would need updating.
January 4, 20251 yr Author There should be no problem. Presumably you've exported the flash drive, but you should also ensure that a user is set for access and Windows has issues with public shares with their latest releases
January 5, 20251 yr What is the difference between : - At startup of Array - At First Array Start Only If I understand correctly, the first option will run every time I start the array, whereas the second will only run when the array is started for the first time (basically when the server is started or rebooted), right? Thank you !
January 5, 20251 yr Author 4 minutes ago, Alex.b said: the first option will run every time I start the array, whereas the second will only run when the array is started for the first time (basically when the server is started or rebooted), right? correct
January 13, 20251 yr I've run into a problem where the APPLY button will not save any scheduling settings. I tried to delete and reinstall the plugin, but I received no love. I'm looking for suggestions. Thank you.
January 17, 20251 yr This has been happening a while... webGUI: error: /plugins/user.scripts/exec.php - missing csrf_token This happens whenever I try to schedule another script, and persists after the UnRAID 7.0 upgrade. I can't schedule any more scripts.
January 19, 20251 yr Hello, Is it possible to prevent the logfile output or redirect the logfile to a different storage device? I am running a large backup with rclone, and it generates a 4 GB logfile, which is probably written to the USB stick. If this runs every week, it's not ideal for the stick. Translate with ChatGPT (SORRY)
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.