Kilrah Posted July 5 Share Posted July 5 1 hour ago, bedivereyang said: does the user.scripts plugin come with a script to download xmrig Absolutely not Quote Link to comment
StylishQuoter Posted July 6 Share Posted July 6 (edited) On 5/12/2023 at 1:27 AM, adgilcan said: I think I solved it and post it here for others. The order displayed is defined by the order of the folders in config/plugins/user.scripts/scripts It appears you can rename these without having to alter the name of the script in User Scripts. At least that seems to work for me. I hope that helps D Have 2 question on the order of the scripts displayed in GUI. How can it be linked to the order of folders within a folder since I've always thought such a thing doesn't exist, that there only exist a concept of "Display Order": how a client renders it at the "viewer"'s end (by size, by creation time, etc). And there isn't such a thing as an inherent order of within a folder. 1. How can I change the GUI order currently? (a.k.a how to change the order of `config/plugins/user.scripts/scripts`?) 2. Can we change it so that the order is just by the name of the script? (this will also satisfy this feature request ) Thanks! Edited July 6 by StylishQuoter Quote Link to comment
oldsweatyman Posted July 10 Share Posted July 10 Hey everyone. I'm another user having trouble with the log button not showing, which occurs even if I run a script in the background. Not sure what to do -- here's an example attached, before aborting the script and after. Quote Link to comment
House Of Cards Posted August 11 Share Posted August 11 All of a sudden, when I try to apply the cron schedule changes, I get this... error: /plugins/user.scripts/exec.php: missing csrf_token UnRAID v6.12.10 User Scripts v2024.03.29 Any idea why this would happen out of the blue? I haven't updated anything... Quote Link to comment
Percutio Posted August 12 Share Posted August 12 (edited) I am having this issue where User Scripts seems to be running a script twice. The schedule of my scripts are "At Startup of Array" and the logs show this: Script Starting Jul 09, 2024 20:50.57 Full logs for this script are available at /tmp/user.scripts/tmpScripts/HDDmain snapshotting/log.txt Script Finished Jul 09, 2024 20:50.57 Full logs for this script are available at /tmp/user.scripts/tmpScripts/HDDmain snapshotting/log.txt Script Starting Jul 09, 2024 22:38.51 Full logs for this script are available at /tmp/user.scripts/tmpScripts/HDDmain snapshotting/log.txt Script Finished Jul 09, 2024 22:38.51 Full logs for this script are available at /tmp/user.scripts/tmpScripts/HDDmain snapshotting/log.txt Script Starting Jul 09, 2024 20:50.57 Full logs for this script are available at /tmp/user.scripts/tmpScripts/SSDmain snapshotting/log.txt Script Finished Jul 09, 2024 20:50.57 Full logs for this script are available at /tmp/user.scripts/tmpScripts/SSDmain snapshotting/log.txt Script Starting Jul 09, 2024 22:38.51 Full logs for this script are available at /tmp/user.scripts/tmpScripts/SSDmain snapshotting/log.txt Script Finished Jul 09, 2024 22:38.51 Full logs for this script are available at /tmp/user.scripts/tmpScripts/SSDmain snapshotting/log.txt The scripts add a cronjob for Sanoid like this #!/bin/bash (crontab -l 2>/dev/null; echo "*/5 * * * * /usr/local/sbin/sanoid --configdir=/mnt/ssdmain --cron") | crontab - And crontab -l confirms the cronjob is being added twice root@Alagaesia:~# crontab -l # If you don't want the output of a cron job mailed to you, you have to direct # any output to /dev/null. We'll do this here since these jobs should run # properly on a newly installed system. If a script fails, run-parts will # mail a notice to root. # # Run the hourly, daily, weekly, and monthly cron jobs. # Jobs that need different timing may be entered into the crontab as before, # but most really don't need greater granularity than this. If the exact # times of the hourly, daily, weekly, and monthly cron jobs do not suit your # needs, feel free to adjust them. # # Run hourly cron jobs at 47 minutes after the hour: 47 * * * * /usr/bin/run-parts /etc/cron.hourly 1> /dev/null # # Run daily cron jobs at 4:40 every day: 40 4 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null # # Run weekly cron jobs at 4:30 on the first day of the week: 30 4 * * 0 /usr/bin/run-parts /etc/cron.weekly 1> /dev/null # # Run monthly cron jobs at 4:20 on the first day of the month: 20 4 1 * * /usr/bin/run-parts /etc/cron.monthly 1> /dev/null */5 * * * * /usr/local/sbin/sanoid --configdir=/mnt/hddmain --cron */5 * * * * /usr/local/sbin/sanoid --configdir=/mnt/ssdmain --cron */5 * * * * /usr/local/sbin/sanoid --configdir=/mnt/hddmain --cron */5 * * * * /usr/local/sbin/sanoid --configdir=/mnt/ssdmain --cron I think this has been happening since I first used User Scripts(over a year+), but I only ever used User Scripts for Sanoid so duplicate snapshots did not affect me much. I only now am diving deeper into this issue since I am currently changing some of my Sanoid schedules. Edited August 12 by Percutio Added all scripts image Quote Link to comment
House Of Cards Posted August 17 Share Posted August 17 On 8/10/2024 at 11:53 PM, House Of Cards said: All of a sudden, when I try to apply the cron schedule changes, I get this... error: /plugins/user.scripts/exec.php: missing csrf_token UnRAID v6.12.10 User Scripts v2024.03.29 Any idea why this would happen out of the blue? I haven't updated anything... No ideas? Everything is up to date. Restarted. Nothing fixes this.... Quote Link to comment
JorgeB Posted August 18 Share Posted August 18 18 hours ago, House Of Cards said: No ideas? Everything is up to date. Post the diags to confirm the plugin is up to date. Quote Link to comment
House Of Cards Posted August 18 Share Posted August 18 7 hours ago, JorgeB said: Post the diags to confirm the plugin is up to date. Here you go. Thanks for the help... diagnostics-20240818-1304.zip Quote Link to comment
JorgeB Posted August 19 Share Posted August 19 @Squidany idea why this is happening with up to date plugin? On 8/17/2024 at 3:40 PM, House Of Cards said: error: /plugins/user.scripts/exec.php: missing csrf_token 1 Quote Link to comment
House Of Cards Posted August 28 Share Posted August 28 On 8/19/2024 at 6:39 AM, JorgeB said: @Squidany idea why this is happening with up to date plugin? I'm a bit disappointed there are no ideas here. I've been in a holding pattern for a month with this not working. I have close to 250 scripts, and I can no longer edit a schedule for them. Quote Link to comment
WizADSL Posted August 28 Share Posted August 28 2 hours ago, House Of Cards said: I'm a bit disappointed there are no ideas here. I've been in a holding pattern for a month with this not working. I have close to 250 scripts, and I can no longer edit a schedule for them. There is the unlikely possibility that a plugin in your browser could be interfering. Could you try to make a trivial change from the browser on your phone and see if that works? 1 Quote Link to comment
Yusseiin Posted August 29 Share Posted August 29 (edited) Hi all, i have a problem with "rsync" log when running in background. I am not able to see the file progression Opening the "log.txt" it seems that the file progression is written in one line without going in a new line How is the break line done? can i change something to make this working? Edited August 29 by Yusseiin Quote Link to comment
House Of Cards Posted August 29 Share Posted August 29 23 hours ago, WizADSL said: There is the unlikely possibility that a plugin in your browser could be interfering. Could you try to make a trivial change from the browser on your phone and see if that works? Same result when I do that. I also disabled anything on the firewall for ad-blocking previously, but same. From what I understand it's a cross site token or something, designed to guard against attacks so I went exploring that angle a bit... Thing is I haven't changed anything besides upgrading UnRAID. It was perfect until now, and seemingly without reason, but there have been no updates on this plugin since like march... Quote Link to comment
JorgeB Posted August 29 Share Posted August 29 It strange because there are a lot of other users using the plugin, including myself, without issues, but that error is usually a plugin issue, so not sure where the issue comes from. Quote Link to comment
House Of Cards Posted August 29 Share Posted August 29 17 minutes ago, JorgeB said: It strange because there are a lot of other users using the plugin, including myself, without issues, but that error is usually a plugin issue, so not sure where the issue comes from. I'll keep looking. I know it works, so I'm probably a unicorn in this regard. It's gotta be something on my end, just not sure what. Quote Link to comment
House Of Cards Posted August 30 Share Posted August 30 20 hours ago, House Of Cards said: I'll keep looking. I know it works, so I'm probably a unicorn in this regard. It's gotta be something on my end, just not sure what. I installed Tailscale, and accessed the server over the cell network remotely over the VPN, so completely independent of my network and browsers, same issue. Could it be related to the number of scripts? Is there a limit that may throw an error? I was hoping @Squid would have some insight... Quote Link to comment
Daburgers Posted September 10 Share Posted September 10 (edited) Hi All, I need help running scripts with custom cron schedule as they don't seem to be running at the schedule I set. I only have 2 scripts. An antivirus script and a clear drive script. I wanted to schedule the Antivirus script but didn't seem to run at the time i set. However, when I click 'run script', 'run in background', or using the pre-defined schedule (I used 'at stopping of array' for testing) they work without any issue. I tested again by making a new simple script with a custom cron schedule set: #!/bin/bash powerdown I set the cron schedule to: 0 9 * * * (fyi, It was 8:45am when I set the schedule) (9am every every day) I waited a few minutes after 9am but nothing happened (server did not power down) and no log was recorded. I did try at different times as well....9:05am, 11:30am - 5 9 * * * , 30 11 * * * , etc. Also tried every 30 seconds.... 30 * * * *) However, I was able to run the script when clicking 'run script', 'run in background', or using the pre-defined schedule as tested above and the device powered down accordingly. A log was created as well. I also made sure that the system date and time was also correct. So I am a bit stumped as to why it won't run. I have attached the unraid logs in case that helps. Also ran the commands below in case that helps - i did see some posts suggest running this and can see the script has been added to it. Would greatly appreciate any help. Please see below: root@Tower:~# crontab -l # If you don't want the output of a cron job mailed to you, you have to direct # any output to /dev/null. We'll do this here since these jobs should run # properly on a newly installed system. If a script fails, run-parts will # mail a notice to root. # # Run the hourly, daily, weekly, and monthly cron jobs. # Jobs that need different timing may be entered into the crontab as before, # but most really don't need greater granularity than this. If the exact # times of the hourly, daily, weekly, and monthly cron jobs do not suit your # needs, feel free to adjust them. # # Run hourly cron jobs at 47 minutes after the hour: 47 * * * * /usr/bin/run-parts /etc/cron.hourly 1> /dev/null # # Run daily cron jobs at 4:40 every day: 40 4 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null # # Run weekly cron jobs at 4:30 on the first day of the week: 30 4 * * 0 /usr/bin/run-parts /etc/cron.weekly 1> /dev/null # # Run monthly cron jobs at 4:20 on the first day of the month: 20 4 1 * * /usr/bin/run-parts /etc/cron.monthly 1> /dev/null 8 9 * * * /usr/local/emhttp/plugins/nvidia-driver/include/update-check.sh &>/dev/null 2>&1 # Job for VM Backup plugin default: 0 3 * * 0 /usr/local/emhttp/plugins/vmbackup/runscript.php run_backup default > /dev/null 2>&1 root@Tower:~# cat /etc/cron.d/root # Generated docker monitoring schedule: 10 0 * * 1 /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/dockerupdate check &> /dev/null # Generated system monitoring schedule: */1 * * * * /usr/local/emhttp/plugins/dynamix/scripts/monitor &> /dev/null # Generated mover schedule: 0 0 1 * * /usr/local/sbin/mover &> /dev/null # Generated plugins version check schedule: 10 0 * * 1 /usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugincheck &> /dev/null # Generated array status check schedule: 20 0 * * * /usr/local/emhttp/plugins/dynamix/scripts/statuscheck &> /dev/null # Generated Unraid OS update check schedule: 11 0 1 * * /usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/unraidcheck &> /dev/null # Generated cron settings for docker autoupdates 0 0 * * * /usr/local/emhttp/plugins/ca.update.applications/scripts/updateDocker.php >/dev/null 2>&1 # Generated cron settings for plugin autoupdates 0 0 * * * /usr/local/emhttp/plugins/ca.update.applications/scripts/updateApplications.php >/dev/null 2>&1 # CRON for CA background scanning of applications 57 * * * * php /usr/local/emhttp/plugins/community.applications/scripts/notices.php > /dev/null 2>&1 # Generated system data collection schedule: */1 * * * * /usr/local/emhttp/plugins/dynamix.system.stats/scripts/sa1 1 1 &> /dev/null # Generated cron schedule for user.scripts 0 9 * * * /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/powerdown/script > /dev/null 2>&1 tower-diagnostics-20240909-0934.zip Edited September 10 by Daburgers more context Quote Link to comment
Daburgers Posted September 14 Share Posted September 14 (edited) On 9/10/2024 at 2:29 PM, Daburgers said: Hi All, I need help running scripts with custom cron schedule as they don't seem to be running at the schedule I set. I only have 2 scripts. An antivirus script and a clear drive script. I wanted to schedule the Antivirus script but didn't seem to run at the time i set. However, when I click 'run script', 'run in background', or using the pre-defined schedule (I used 'at stopping of array' for testing) they work without any issue. I tested again by making a new simple script with a custom cron schedule set: #!/bin/bash powerdown I set the cron schedule to: 0 9 * * * (fyi, It was 8:45am when I set the schedule) (9am every every day) I waited a few minutes after 9am but nothing happened (server did not power down) and no log was recorded. I did try at different times as well....9:05am, 11:30am - 5 9 * * * , 30 11 * * * , etc. Also tried every 30 seconds.... 30 * * * *) However, I was able to run the script when clicking 'run script', 'run in background', or using the pre-defined schedule as tested above and the device powered down accordingly. A log was created as well. I also made sure that the system date and time was also correct. So I am a bit stumped as to why it won't run. I have attached the unraid logs in case that helps. Also ran the commands below in case that helps - i did see some posts suggest running this and can see the script has been added to it. Would greatly appreciate any help. Please see below: root@Tower:~# crontab -l # If you don't want the output of a cron job mailed to you, you have to direct # any output to /dev/null. We'll do this here since these jobs should run # properly on a newly installed system. If a script fails, run-parts will # mail a notice to root. # # Run the hourly, daily, weekly, and monthly cron jobs. # Jobs that need different timing may be entered into the crontab as before, # but most really don't need greater granularity than this. If the exact # times of the hourly, daily, weekly, and monthly cron jobs do not suit your # needs, feel free to adjust them. # # Run hourly cron jobs at 47 minutes after the hour: 47 * * * * /usr/bin/run-parts /etc/cron.hourly 1> /dev/null # # Run daily cron jobs at 4:40 every day: 40 4 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null # # Run weekly cron jobs at 4:30 on the first day of the week: 30 4 * * 0 /usr/bin/run-parts /etc/cron.weekly 1> /dev/null # # Run monthly cron jobs at 4:20 on the first day of the month: 20 4 1 * * /usr/bin/run-parts /etc/cron.monthly 1> /dev/null 8 9 * * * /usr/local/emhttp/plugins/nvidia-driver/include/update-check.sh &>/dev/null 2>&1 # Job for VM Backup plugin default: 0 3 * * 0 /usr/local/emhttp/plugins/vmbackup/runscript.php run_backup default > /dev/null 2>&1 root@Tower:~# cat /etc/cron.d/root # Generated docker monitoring schedule: 10 0 * * 1 /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/dockerupdate check &> /dev/null # Generated system monitoring schedule: */1 * * * * /usr/local/emhttp/plugins/dynamix/scripts/monitor &> /dev/null # Generated mover schedule: 0 0 1 * * /usr/local/sbin/mover &> /dev/null # Generated plugins version check schedule: 10 0 * * 1 /usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugincheck &> /dev/null # Generated array status check schedule: 20 0 * * * /usr/local/emhttp/plugins/dynamix/scripts/statuscheck &> /dev/null # Generated Unraid OS update check schedule: 11 0 1 * * /usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/unraidcheck &> /dev/null # Generated cron settings for docker autoupdates 0 0 * * * /usr/local/emhttp/plugins/ca.update.applications/scripts/updateDocker.php >/dev/null 2>&1 # Generated cron settings for plugin autoupdates 0 0 * * * /usr/local/emhttp/plugins/ca.update.applications/scripts/updateApplications.php >/dev/null 2>&1 # CRON for CA background scanning of applications 57 * * * * php /usr/local/emhttp/plugins/community.applications/scripts/notices.php > /dev/null 2>&1 # Generated system data collection schedule: */1 * * * * /usr/local/emhttp/plugins/dynamix.system.stats/scripts/sa1 1 1 &> /dev/null # Generated cron schedule for user.scripts 0 9 * * * /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/powerdown/script > /dev/null 2>&1 tower-diagnostics-20240909-0934.zip 231.44 kB · 0 downloads 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: Edited September 14 by Daburgers Quote Link to comment
mgutt Posted September 22 Share Posted September 22 I like to have: Support of @reboot in dropdown (it can be stored through the custom field, but after server reboot it is not part of /etc/cron.d/root) (yes, I need it before array start 😉) Store script logs in /var/log/script Make use of logrotate for /var/log/script Optional permanent logs to flash drive (dropdown with hourly/daily/weekly for people not wanting permanent writes, uses rsync --delete to keep in sync with logrotate cleanups) Store executable scripts with their name in /usr/local/bin Optional custom share to edit scripts through SMB. Example: [user-scripts-plugin] path = /usr/local/bin valid users = <selected-user> read list = write list = <selected-user> force user = root (should be 7.) if the user kills a background script, you should fire this: pkill -P <PID_OF_SCRIPT> By that child commands like rsync or background commands are killed as well. Quote Link to comment
Espressomatic Posted September 22 Share Posted September 22 (edited) If we're doing suggestions for new features: Allow providing a github URL for a script and an option to auto-update. On 8/28/2024 at 11:33 AM, House Of Cards said: I'm a bit disappointed there are no ideas here. I've been in a holding pattern for a month with this not working. I have close to 250 scripts, and I can no longer edit a schedule for them. Spin up Unraid 7.0.0beta2 on a spare USB stick and give it a try. Edited September 22 by Espressomatic 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.