Unpack5920 Posted October 17, 2022 Share Posted October 17, 2022 Small Feature-Request Could you please sort the User Script List by name. I use script names like: backup-share_docker backup-share_appdata cleanup-delete_ds_store power-force_sleep ... Sorting would group them accordingly Thank you in advance. Quote Link to comment
Knowcontrol Posted October 20, 2022 Share Posted October 20, 2022 Relatively new Unraid install - 6.11.1. Installed the User Scripts plugin. I am unable to "Apply" any changes whether it's changing the schedule from the dropdown list or setting a cron schedule. Pressing the Apply button seems to do nothing, pressing Done losses all changes. I've tried Firefox, Chrome, and Edge. I uninstalled the plugin but then reinstalling it just retained any previous scripts and settings and the Apply button still doesn't function. Thoughts? Quote Link to comment
Squid Posted October 20, 2022 Author Share Posted October 20, 2022 Flash problem? Post your diagnostics Quote Link to comment
Knowcontrol Posted October 20, 2022 Share Posted October 20, 2022 2 hours ago, Squid said: Flash problem? Post your diagnostics apollo-diagnostics-20221020-1229.zip Quote Link to comment
geromme Posted October 21, 2022 Share Posted October 21, 2022 (edited) After a server restart all my schedules aren't set, but there are still in the plugins config file?! Edited October 21, 2022 by geromme Quote Link to comment
Viper359 Posted October 24, 2022 Share Posted October 24, 2022 (edited) Disregard, I am a blooming idiot who can't read properly. Edited October 24, 2022 by Viper359 Quote Link to comment
kennand Posted October 30, 2022 Share Posted October 30, 2022 Since I updated User-Script to the latest version and updated Unraid to 6.11.1, my User-Script cannot display logs, what is the reason? Quote Link to comment
alturismo Posted October 30, 2022 Share Posted October 30, 2022 7 hours ago, kennand said: Since I updated User-Script to the latest version and updated Unraid to 6.11.1, my User-Script cannot display logs, what is the reason? and they already ran once ? as if you just updated ... they need to run atleast once to have a log just in case you expected "old" logs Quote Link to comment
Squid Posted October 31, 2022 Author Share Posted October 31, 2022 And they're not persistent - all logs are lost on a reboot Quote Link to comment
IMTheNachoMan Posted October 31, 2022 Share Posted October 31, 2022 4 minutes ago, usr.local said: Wouldn't it be better to save logs to /boot/logs so they are persistent? Logs can take up a lot of space and hammer a lot of writes -- which isn't great for a USB stick. My scripts make a copy of the latest log files, as I need them, to my storage. Quote Link to comment
kennand Posted October 31, 2022 Share Posted October 31, 2022 17 hours ago, alturismo said: and they already ran once ? as if you just updated ... they need to run atleast once to have a log just in case you expected "old" logs yes,they already run many times Quote Link to comment
wgstarks Posted October 31, 2022 Share Posted October 31, 2022 2 hours ago, usr.local said: I log all of them to /boot/logs and have never had to replace my USB drive. Why not just use the builtin syslog server? Quote Link to comment
ConnerVT Posted October 31, 2022 Share Posted October 31, 2022 4 hours ago, usr.local said: I can't imagine that you would use more memory available on a usb stick to make that much difference. If you you do, then I would say you should purchase a decent USB stick for less than $20.00. Not so much about how much memory storage a USB drive has than trying to limit how much writing activity the flash drive sees. Thumb drives aren't designed to be a general storage drive but rather for storage to archive and transport data from one system to another. One of the main reasons of flash drive failure is from heat generated from continuous writes. It has become more an issue with drives capacities and speeds increasing. Most flash drives have little to no heat absorbing mass to dissipate the heat generated by multiple writes. While text logs generally don't have many writes, it still may be best to be in the mindset to limit writes to your boot flash to only those that are needed to be there. There has also been a large number of people finding themselves with counterfeit flash drives they though were genuine products from major suppliers (SanDisk, Samsung). Many of these were purchased from popular sources such as Amazon. So you can not know for sure your new flash drive is one of the decent ones. Quote Link to comment
alturismo Posted October 31, 2022 Share Posted October 31, 2022 10 hours ago, kennand said: yes,they already run many times then i would start run it manually and see what comes in the box, if there are "logs" and not written to logs ... may take a look at syslog parallel to see if there are any errors like "not writeable" ... Quote Link to comment
kennand Posted November 2, 2022 Share Posted November 2, 2022 On 11/1/2022 at 3:05 AM, alturismo said: then i would start run it manually and see what comes in the box, if there are "logs" and not written to logs ... may take a look at syslog parallel to see if there are any errors like "not writeable" ... I found that only when I click "run in background" can logs appear. If I click "RUN SCRIPT" or run script automatically on a regular basis, no logs will be generated Quote Link to comment
IMTheNachoMan Posted November 2, 2022 Share Posted November 2, 2022 On 10/31/2022 at 5:22 AM, usr.local said: I can't imagine that you would use more memory available on a usb stick to make that much difference. If you you do, then I would say you should purchase a decent USB stick for less than $20.00. One configuration mistake, or some issue, and you could write gigs to a log file. It depends on the log file. You generally never want to write logs to a boot folder/partition/drive. 1 Quote Link to comment
aarontry Posted November 3, 2022 Share Posted November 3, 2022 I have a rsync job running every 5 mins from 6AM to 10PM but the cron job doesn't honor the schedule. Is my schedule format correct? 0/5 6-22 * * * Quote Link to comment
Squid Posted November 3, 2022 Author Share Posted November 3, 2022 9 hours ago, aarontry said: I have a rsync job running every 5 mins from 6AM to 10PM but the cron job doesn't honor the schedule. Is my schedule format correct? 0/5 6-22 * * * I would try expanding the 6-22 to instead be 6,7,8... Quote Link to comment
MasterMark Posted November 5, 2022 Share Posted November 5, 2022 (edited) Hi, I have a very simple python script but if I run it via the user scripts the execution is not in order. subprocess.run running before everything at the start of the script, however it is called later in the script. Do you have idea what is causing this? If I run the script manually in ssh shell it is executing the commands in order. edit: I am not sure right now. Maybe just the output is not in order in the log? The script: #!/usr/bin/python3 import shutil import subprocess print("Starting") letsencryptCert = "/mnt/user/appdata/swag/etc/letsencrypt/live/my.domain/priv-fullchain-bundle.pem" guiCert = "/boot/config/ssl/certs/TOWER_unraid_bundle.pem" print("Copy certificate...") shutil.copyfile(letsencryptCert, guiCert) print("Reload WebGUI...") subprocess.run(["/etc/rc.d/rc.nginx", "reload"]) print("Finished") Edited November 5, 2022 by MasterMark Quote Link to comment
voidpointer Posted November 7, 2022 Share Posted November 7, 2022 Is there a way to run a script not only after the array is started but only when the docker daemon is available? Quote Link to comment
FQs19 Posted November 8, 2022 Share Posted November 8, 2022 (edited) I'm having an issue with my scripts not showing the logs after clicking on Run Script. The logs will show after clicking on Run in Background. I believe my NTP server settings weren't correct. I fixed that, but I still can't get two of my scripts to work at all. Could anyone tell me what is going on? Here are the two scripts I need help with: -first "arraycache errors": Spoiler #!/bin/bash if mountpoint -q /mnt/arraycache; then btrfs dev stats -c /mnt/arraycache if [[ $? -ne 0 ]]; then /usr/local/emhttp/webGui/scripts/notify -i warning -s "ERRORS on arraycache pool"; fi fi -second "plexcache errors": Spoiler #!/bin/bash if mountpoint -q /mnt/plexcache; then btrfs dev stats -c /mnt/plexcache if [[ $? -ne 0 ]]; then /usr/local/emhttp/webGui/scripts/notify -i warning -s "ERRORS on plexcache pool"; fi fi Here's the output of "cat /etc/cron.d/root": Spoiler root@Threadripper19:~# cat /etc/cron.d/root # Generated btrfs balance arraycache schedule: 0 12 1 * * /usr/local/emhttp/plugins/dynamix/scripts/btrfs_balance start /mnt/arraycache -dusage=50 &> /dev/null # Generated btrfs balance nvmecache schedule: 30 12 1 * * /usr/local/emhttp/plugins/dynamix/scripts/btrfs_balance start /mnt/nvmecache -dusage=50 &> /dev/null # Generated btrfs balance plexcache schedule: 5 12 1 * * /usr/local/emhttp/plugins/dynamix/scripts/btrfs_balance start /mnt/plexcache -dusage=50 &> /dev/null # Generated docker monitoring schedule: 10 0 * * * /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/dockerupdate check &> /dev/null # Generated languages version check schedule: 10 0 1 * * /usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/languagecheck &> /dev/null # Generated system monitoring schedule: */1 * * * * /usr/local/emhttp/plugins/dynamix/scripts/monitor &> /dev/null # Generated mover schedule: 0 9 * * 0 /usr/local/sbin/mover &> /dev/null # Generated parity check schedule: 0 22 * 1,4,7,10 2 [[ $(date +%e -d +7days) -le 7 ]] && /usr/local/sbin/mdcmd check NOCORRECT &> /dev/null || : # Generated plugins version check schedule: 10 0 * * 1 /usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugincheck &> /dev/null # Generated btrfs scrub arraycache schedule: 0 11 * * 0 /usr/local/emhttp/plugins/dynamix/scripts/btrfs_scrub start /mnt/arraycache -r &> /dev/null # Generated btrfs scrub nvmecache schedule: 30 11 * * 0 /usr/local/emhttp/plugins/dynamix/scripts/btrfs_scrub start /mnt/nvmecache -r &> /dev/null # Generated btrfs scrub plexcache schedule: 5 11 * * 0 /usr/local/emhttp/plugins/dynamix/scripts/btrfs_scrub start /mnt/plexcache -r &> /dev/null # Generated ssd trim schedule: 0 1 * * 0 /sbin/fstrim -a -v | logger &> /dev/null # Generated array status check schedule: 20 0 * * 1 /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 9 * * 0 /usr/local/emhttp/plugins/ca.update.applications/scripts/updateDocker.php >/dev/null 2>&1 # Generated cron settings for plugin autoupdates 0 10 * * * /usr/local/emhttp/plugins/ca.update.applications/scripts/updateApplications.php >/dev/null 2>&1 I'm also attaching my unRAID diagnostics for your review. Any help is appreciated. Thanks threadripper19-diagnostics-20221107-2014.zip Edited November 8, 2022 by FQs19 spelling correction Quote Link to comment
FQs19 Posted November 8, 2022 Share Posted November 8, 2022 6 minutes ago, FQs19 said: I'm having an issue with my scripts not showing the logs after clicking on Run Script. The logs will show after clicking on Run in Background. I believe my NTP server settings weren't correct. I fixed that, but I still can't get two of my scripts to work at all. Could anyone tell me what is going on? Here are the two scripts I need help with: -first "arraycache errors": Reveal hidden contents #!/bin/bash if mountpoint -q /mnt/arraycache; then btrfs dev stats -c /mnt/arraycache if [[ $? -ne 0 ]]; then /usr/local/emhttp/webGui/scripts/notify -i warning -s "ERRORS on arraycache pool"; fi fi -second "plexcache errors": Reveal hidden contents #!/bin/bash if mountpoint -q /mnt/plexcache; then btrfs dev stats -c /mnt/plexcache if [[ $? -ne 0 ]]; then /usr/local/emhttp/webGui/scripts/notify -i warning -s "ERRORS on plexcache pool"; fi fi Here's the output of "cat /etc/cron.d/root": Reveal hidden contents root@Threadripper19:~# cat /etc/cron.d/root # Generated btrfs balance arraycache schedule: 0 12 1 * * /usr/local/emhttp/plugins/dynamix/scripts/btrfs_balance start /mnt/arraycache -dusage=50 &> /dev/null # Generated btrfs balance nvmecache schedule: 30 12 1 * * /usr/local/emhttp/plugins/dynamix/scripts/btrfs_balance start /mnt/nvmecache -dusage=50 &> /dev/null # Generated btrfs balance plexcache schedule: 5 12 1 * * /usr/local/emhttp/plugins/dynamix/scripts/btrfs_balance start /mnt/plexcache -dusage=50 &> /dev/null # Generated docker monitoring schedule: 10 0 * * * /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/dockerupdate check &> /dev/null # Generated languages version check schedule: 10 0 1 * * /usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/languagecheck &> /dev/null # Generated system monitoring schedule: */1 * * * * /usr/local/emhttp/plugins/dynamix/scripts/monitor &> /dev/null # Generated mover schedule: 0 9 * * 0 /usr/local/sbin/mover &> /dev/null # Generated parity check schedule: 0 22 * 1,4,7,10 2 [[ $(date +%e -d +7days) -le 7 ]] && /usr/local/sbin/mdcmd check NOCORRECT &> /dev/null || : # Generated plugins version check schedule: 10 0 * * 1 /usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugincheck &> /dev/null # Generated btrfs scrub arraycache schedule: 0 11 * * 0 /usr/local/emhttp/plugins/dynamix/scripts/btrfs_scrub start /mnt/arraycache -r &> /dev/null # Generated btrfs scrub nvmecache schedule: 30 11 * * 0 /usr/local/emhttp/plugins/dynamix/scripts/btrfs_scrub start /mnt/nvmecache -r &> /dev/null # Generated btrfs scrub plexcache schedule: 5 11 * * 0 /usr/local/emhttp/plugins/dynamix/scripts/btrfs_scrub start /mnt/plexcache -r &> /dev/null # Generated ssd trim schedule: 0 1 * * 0 /sbin/fstrim -a -v | logger &> /dev/null # Generated array status check schedule: 20 0 * * 1 /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 9 * * 0 /usr/local/emhttp/plugins/ca.update.applications/scripts/updateDocker.php >/dev/null 2>&1 # Generated cron settings for plugin autoupdates 0 10 * * * /usr/local/emhttp/plugins/ca.update.applications/scripts/updateApplications.php >/dev/null 2>&1 I'm also attaching my unRAID diagnostics for your review. Any help is appreciated. Thanks threadripper19-diagnostics-20221107-2014.zip 140.82 kB · 0 downloads It would help if I actually started my array. Attached is the diagnostics after starting my array and running the first script with Run then Run in Background. Here's the output of "cat /etc/cron.d/root": Spoiler root@Threadripper19:~# cat /etc/cron.d/root # Generated btrfs balance arraycache schedule: 0 12 1 * * /usr/local/emhttp/plugins/dynamix/scripts/btrfs_balance start /mnt/arraycache -dusage=50 &> /dev/null # Generated btrfs balance nvmecache schedule: 30 12 1 * * /usr/local/emhttp/plugins/dynamix/scripts/btrfs_balance start /mnt/nvmecache -dusage=50 &> /dev/null # Generated btrfs balance plexcache schedule: 5 12 1 * * /usr/local/emhttp/plugins/dynamix/scripts/btrfs_balance start /mnt/plexcache -dusage=50 &> /dev/null # Generated docker monitoring schedule: 10 0 * * * /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/dockerupdate check &> /dev/null # Generated languages version check schedule: 10 0 1 * * /usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/languagecheck &> /dev/null # Generated system monitoring schedule: */1 * * * * /usr/local/emhttp/plugins/dynamix/scripts/monitor &> /dev/null # Generated mover schedule: 0 9 * * 0 /usr/local/sbin/mover &> /dev/null # Generated parity check schedule: 0 22 * 1,4,7,10 2 [[ $(date +%e -d +7days) -le 7 ]] && /usr/local/sbin/mdcmd check NOCORRECT &> /dev/null || : # Generated plugins version check schedule: 10 0 * * 1 /usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugincheck &> /dev/null # Generated btrfs scrub arraycache schedule: 0 11 * * 0 /usr/local/emhttp/plugins/dynamix/scripts/btrfs_scrub start /mnt/arraycache -r &> /dev/null # Generated btrfs scrub nvmecache schedule: 30 11 * * 0 /usr/local/emhttp/plugins/dynamix/scripts/btrfs_scrub start /mnt/nvmecache -r &> /dev/null # Generated btrfs scrub plexcache schedule: 5 11 * * 0 /usr/local/emhttp/plugins/dynamix/scripts/btrfs_scrub start /mnt/plexcache -r &> /dev/null # Generated ssd trim schedule: 0 1 * * 0 /sbin/fstrim -a -v | logger &> /dev/null # Generated array status check schedule: 20 0 * * 1 /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 9 * * 0 /usr/local/emhttp/plugins/ca.update.applications/scripts/updateDocker.php >/dev/null 2>&1 # Generated cron settings for plugin autoupdates 0 10 * * * /usr/local/emhttp/plugins/ca.update.applications/scripts/updateApplications.php >/dev/null 2>&1 # CRON for CA background scanning of applications 26 * * * * php /usr/local/emhttp/plugins/community.applications/scripts/notices.php > /dev/null 2>&1 # Generated local master browser check: */1 * * * * /usr/local/emhttp/plugins/dynamix.local.master/scripts/localmaster &> /dev/null # 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 0,8,16 * * * /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/btrfs_error_monitoring/script > /dev/null 2>&1 0 0,,8,16 * * * /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/btrfs_error_monitoring_plexcache/script > /dev/null 2>&1 threadripper19-diagnostics-20221107-2020.zip Quote Link to comment
bullmoose20 Posted November 9, 2022 Share Posted November 9, 2022 Here is my super simple script... #!/bin/bash cd /mnt/user/data/bullmoose20/Documents/Plex-Meta-Manager-Images sudo tree --charset=ascii people > people_listing2.txt ############## # chown # ############## chown nobody people_listing2.txt ############## # chgrp # ############## chgrp users people_listing2.txt ############## # chmod # ############## chmod 666 people_listing2.txt When I run this manually in Unraid User Scripts, I get the following output: people |-- bw | |-- Aaron Beelner.jpg | |-- Aaron Eckhart.jpg | |-- Aaron Lazar.jpg | |-- Aaron Nee.jpg | |-- Aaron O'Connell.jpg | |-- Aaron Paul.jpg | |-- Aaron Ryder.jpg | |-- Aaron Schneider.jpg | |-- Aaron Schwartz.jpg | |-- Aaron Sorkin.jpg | |-- Aaron Stanford.jpg | |-- Aaron Taylor-Johnson.jpg | |-- Aaron W Reed.jpg | |-- Aarón Díaz.jpg | |-- Abbey Hoes.jpg | |-- Abby Elliott.jpg However, when it runs every 5 minutes, I get the following output: people |-- bw | |-- Aaron\ Beelner.jpg | |-- Aaron\ Eckhart.jpg | |-- Aaron\ Lazar.jpg | |-- Aaron\ Nee.jpg | |-- Aaron\ O'Connell.jpg | |-- Aaron\ Paul.jpg | |-- Aaron\ Ryder.jpg | |-- Aaron\ Schneider.jpg | |-- Aaron\ Schwartz.jpg | |-- Aaron\ Sorkin.jpg | |-- Aaron\ Stanford.jpg | |-- Aaron\ Taylor-Johnson.jpg | |-- Aaron\ W\ Reed.jpg | |-- Aar\303\263n\ D\303\255az.jpg | |-- Abbey\ Hoes.jpg | |-- Abby\ Elliott.jpg Notice the backslashes and notice the Aarón Díaz.jpg is missing the characters. Any way I can fix this so that when it runs with the schedule, it keeps the characters and eliminates the backslashes? Quote Link to comment
matuopm Posted November 13, 2022 Share Posted November 13, 2022 Is there a documentation about the "custom cron schedule" syntax ? I want to run a script every day at 0:00 but don't know how to write it Quote Link to comment
KnifeFed Posted November 13, 2022 Share Posted November 13, 2022 31 minutes ago, matuopm said: Is there a documentation about the "custom cron schedule" syntax ? I want to run a script every day at 0:00 but don't know how to write it The cron Wikipedia article explains the syntax pretty well. You can use a generator, e.g. Crontab.guru, to get the expression you need. "Every day at 0:00" would be: 0 0 * * * 1 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.