June 4, 20251 yr Are users able to organize their scripts into folders similar to folders for Docker containers via the FolderView2 plugin?I've got a lot of scripts, not all of which are given a schedule, but they're there for use when necessary. Sifting through them in alphabetical order rather than what I'm likely to want at any given moment makes the whole thing quite cumbersome to manage after a while.Even a config option to set a default view that allows filtering Schedule Disabled to the bottom in a separate/divided list, just like how the Main view separates out the array and pools.I also find the lack of alternating colors like in the Main page the Unraid admin GUI makes it extremely hard to parse at a glance.Versioning scripts via Git and being able to pull a Git repository of scripts in would be amazing. I've messed up scripts on a few occasions and lamented the inability to quickly revert back to a previous, diff, or be able to update the scripts from a repository without fiddling around in the GUI.Excellent plugin overall, but oodles of untapped potential. :- )
June 17, 20251 yr Is there a difference between normal crontab jobs and how User Scripts is scheduling jobs?I have a script that I want to run on every first Monday of each month. I have setup User Scripts to use a custom schedule with the following syntax:30 1 */32,1-7 * 1which according to https://crontab.guru/#30_1_*/32,1-7_*_1 should do exactly what I need. However Unraid seems to run this script on every Monday instead:My configs seem to be correct though:root@blackbox:~# cat /boot/config/plugins/user.scripts/customSchedule.cron... # Generated cron schedule for user.scripts 30 1 */32,1-7 * 1 /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/12_backup_monthly/script > /dev/null 2>&1 ...The script is also correctly scheduled in /etc/cron.d/root:root@blackbox:~# cat /etc/cron.d/root... # Generated cron schedule for user.scripts 30 1 */32,1-7 * 1 /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/12_backup_monthly/script > /dev/null 2>&1 ...Why is this not working as expected and how can I fix it? Unraid bug?Thank you very much! Edited June 18, 20251 yr by Tom082
June 19, 20251 yr Hi,Fairly new to unraid, and not super computer literate compared to most people with a server...I'm trying to run a script to change files from hi.srt to sdh.srt. I started a dry run first and everything appeared right so I took that block out and ran it properly. The whole time going through it was letting me know it was renaming files and I didn't see it error out at all. However when it finally finished absolutely nothing was renamed. Just need some help understanding why and what I should change (and ideally why I should change it, so I can learn how this works for future scripts). Script is as follows#!/bin/bashecho "=== STARTING SRT RENAME SCRIPT ==="# Hardcoded root folderroot_folder="/mnt/user/data/media"# Find and process .hi.srt filesfind "$root_folder" -type f -name "*.hi.srt" -print0 | while IFS= read -r -d '' file; do new_file="${file%.hi.srt}.sdh.srt" if [ "$dry_run" = true ]; then echo "[DRY-RUN] Would rename: $file -> $new_file" else # mv "$file" "$new_file" echo "Renamed: $file -> $new_file" fidoneThanks in advance for any help :)
June 19, 20251 yr 51 minutes ago, obsidianwings said:# mv "$file" "$new_file"Remove the # at the start - you've effectively remmed / commented out this line, so the actual renaming is skipped
June 19, 20251 yr Oh, that simple, wow 😂 thank you will take a look at this on the morning. It said it was renaming them so I wasn't expecting that to be the answer. Appreciate it Edited June 19, 20251 yr by obsidianwings
June 19, 20251 yr 23 minutes ago, obsidianwings said:Oh, that simple, wow 😂 thank you will take a look at this on the morning. It said it was renaming them so I wasn't expecting that to be the answer. Appreciate itYeah, the "echo" line after is is what's telling you it's renaming, but since the actual command doing the work was commented out you were effectively doing a dry run. The echo command could say pretty much anything, so feel free to change it to echo "renamed $file, transferred money into bank account 😀
June 19, 20251 yr 5 hours ago, Cessquill said:Yeah, the "echo" line after is is what's telling you it's renaming, but since the actual command doing the work was commented out you were effectively doing a dry run. The echo command could say pretty much anything, so feel free to change it to echo "renamed $file, transferred money into bank account 😀Makes total sense, thank you 😂
June 23, 20251 yr Inline variables described under "HOW TO ADD SCRIPTS" do not work:test script:#!/bin/bashbackgroundOnly=trueargumentDescription=TESTRun in Background button is still enabled, description is not set to TEST
June 27, 20251 yr I was hoping the latest update would fix this, but no luck...For at least a year, I have been unable to schedule a script. When I try to apply a custom schedule, I get a log error of "/plugins/user.scripts/exec.php - missing csrf_token" and the schedule doesn't apply. It worked for 259 other scripts, but since one year ago, I can't schedule another one.I've tried disabling plug-ins, etc... Nothing works.
July 1, 20251 yr I am currently getting a "127" error when trying to update to the latest version. Is there a way to run a more verbose output or manually run the update to troubleshoot why it's failing?Thank you!
July 23, 2025Jul 23 Hi, I'm trying to set up a bash script that spends my bonus points on MAM but this script requires access to some json files that it creates to maintain an active session on MAM. Is there a way to make user scripts keep these files persistent? I also tried setting the bash script within one of my docker containers and running it on a cron job but it doesn't run so I'm guessing cron doesn't work within these containers
August 6, 2025Aug 6 Is anyone having trouble manually firing off a script? I hit the Run in Background button and it acts normally however, the script never runs. BUT, the cron schedule for the script DOES run properly at its allotted time. No idea how long this has been going on since it has probably been 2 months since I manually ran some scripts. And my server has been powered cycled since then, but again, no idea when manual script firing stopped, maybe it was after the power cycle and I need to do it again.Just curious. Thanks!
August 8, 2025Aug 8 Why is "users scripts" on the settings menu and not on the tools menu?ok, it's just me, isn't it?
August 11, 2025Aug 11 Not sure if this is a potential bug but i created a new script and called the script:"Link Overlay2 folders to Container Names! (troubleshooting)"After creating the new script name in the userscipt plugin, the settings cog for the new script dosn't load when clicked on so i'm stuck with this entry and cant delete it, edit it or do anything with it. It's just become stale!Assuming that the way the name has been parsed to the plugin has caused some sort of weird glitch. Likely either the "!" or the "(" or ")" symbols.Can anyone do a quick test to see if they experience the same issue? Add new script > give it the name above in bold. Save. Then try and delete it.Where would be best to post this to get it looked at potentially? Edited August 11, 2025Aug 11 by thestraycat
September 9, 2025Sep 9 Could you possibly mention in the instructions that the arguments that you enter in the comments at the top of the script are then called as positional arguments? The instructions seem so explicit but then just neglect to mention that. It may seem obvious to most, but I was trying to figure out what the arguments were named, if "argumentDefault" was like a placeholder name and we were supposed to change it, or what. It was infuriating until I figured it out. Just a simple "First argument is called as $1, second is $2".. etc. I am sure a lot of newbs and non-newbs alike would find it useful.
September 12, 2025Sep 12 Hello everyone. I have two problems at the moment with the user scripts plug-in. I can't delete some scripts. I click on the gear but nothing happens. is there another way to delete them? I can't set custom schedules. I select custom, add the cron code like */3 * * * * click apply and done. But when I enter user scripts again it's set to schedule disabled. Any ideas to solve the issues? Thanks ahead!
September 12, 2025Sep 12 I had similar issues, had to delete the script manually from the userscript folder via terminal. Not sure when or why it broke.
September 12, 2025Sep 12 46 minutes ago, thestraycat said:I had similar issues, had to delete the script manually from the userscript folder via terminal. Not sure when or why it broke.Thanks for the fast reply. That worked for me also. I deleted a few old unused scripts and now the custom scheduler is working
September 12, 2025Sep 12 For some reason this script only work when i run it myself i want to run it in the background. if i try that it doesnt do anything #!/bin/bash#clearLog=true# Explicitly set the PATH to ensure necessary commands are found in background jobs.PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin# Define log file and a persistent log path.# This ensures a clean log for each run and a persistent backup.LOG_FILE="/tmp/user.scripts/tmpScripts/Hetzner_Storage/log.txt"PERSISTENT_LOG_PATH="/mnt/user/appdata/rclone/hetzner_storage.log"# Create the persistent log directory if it doesn't existmkdir -p "$(dirname "$PERSISTENT_LOG_PATH")"# Execute the rclone command and capture the output to a variable.RCLONE_OUTPUT=$(rclone about hetzner: --log-level INFO 2>&1)# Extract the free space from the rclone output.FREE_SPACE_STR=$(echo "${RCLONE_OUTPUT}" | grep "Free:" | awk '{print $2}')# Clean up the string to get a number.FREE_SPACE_GB=$(echo "${FREE_SPACE_STR}" | sed 's/GBytes//')# Check if free space is less than 50 GB and send a notification if true.# We'll use a simple shell check to compare floating-point numbers.if [ -n "${FREE_SPACE_GB}" ]; then # Use a subshell to perform the comparison without bc. # This rounds down the GB value to the nearest whole number before comparing. INTEGER_FREE_SPACE=$(echo "${FREE_SPACE_GB}" | cut -d'.' -f1) if [ "${INTEGER_FREE_SPACE}" -lt "50" ]; then /usr/local/emhttp/webGui/scripts/notify -e "Hetzner Storage Alert!" -s "ATTENTION: Hetzner Storage Free Space Low" -d "Hetzner storage has less than 50GB of free space. Current free space: ${FREE_SPACE_GB} GBytes." -i warning fifi# Write the rclone output to a temporary log for the plugin widget.echo "${RCLONE_OUTPUT}" | tee "${LOG_FILE}"# Append the contents of the temporary log to the persistent logcat "${LOG_FILE}" >> "${PERSISTENT_LOG_PATH}"
September 13, 2025Sep 13 Author You have to bear in mind that running stuff via the plugin doesn't exactly run it in a shell. Rather it's all ultimately executed from within a PHP script, so there are slight differences including what you already noticed where not all the PATHS are defined
September 20, 2025Sep 20 I wanted to ask, if you also noticed that the plugin has a visual issue when updating unRAID to 7.2.0 beta. Unlike previous unRAID versions, there's no space between the last two elements.It's not a big deal, but it looks ugly (especially because the lines are not at the same height).until 7.2.0 betaWith 7.2.0 beta Edited September 21, 2025Sep 21 by petbrau
September 25, 2025Sep 25 7.2 userscripts has some formatting issues, schedule field is to close to the custom schedule field
September 26, 2025Sep 26 I have the User Scripts Enhanced plugin installed. All the features including exports seem to work fine, with the exception of Export Config. If I select: Settings > User Scripts Enhanced > Export Config, it returns "Error: File not found." Any suggestions on what could be causing this error? Thanks.
October 7, 2025Oct 7 Hi,I have a script I need to run when my pool starts. Looking at the options, there is one for array start but will that still work in my case as I don't have an array, I only have a zfs raid-z2 pool. Will the run on array start still work?
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.