Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Plugin] CA User Scripts

Featured Replies

Everytime I install this plugin and reboot, my cache drives go offline.  After I remove this plugin and reboot, I can then add my cache drives back.  Anyone else have issues like that?

  • Replies 2.1k
  • Views 567.2k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • I could make up something long, convoluted, and technical as a reason why it doesn't do that but it would all be bs.  The simple answer is that when I did this, I never thought of that, and why it sti

  • Hi All - We have a fix and are publishing a Connect plugin update to fix it today. Thanks for letting us know.

  • @Squid I tried many commands and by that I found out that pkill does not kill (all) child processes: root@Thoth:/tmp# pgrep -f isleep2m | xargs --no-run-if-empty ps fp PID TTY STAT T

Posted Images

1 minute ago, theDrell said:

Everytime I install this plugin and reboot, my cache drives go offline.  After I remove this plugin and reboot, I can then add my cache drives back.  Anyone else have issues like that?

Do you have any scripts scheduled with the plugin?

  • Author
6 hours ago, theDrell said:

Everytime I install this plugin and reboot, my cache drives go offline.  After I remove this plugin and reboot, I can then add my cache drives back.  Anyone else have issues like that?

Its not the fault of the plugin.  Unless of course you are running a script that is doing something causing that.

3 hours ago, Squid said:

Its not the fault of the plugin.  Unless of course you are running a script that is doing something causing that.

To the best of my knowledge, there are no scripts scheduled.  It is the first install of that plugin.  I had installed the rclone plugin beforehand, and it seems to stay with no issue, but the userscript one gives me the missing cache drives.  I just looked under the config, the only 3 scripts I see there are delete ds_store, delete dangling images, and viewDockerLogSize.

 

I am on 6.5.3 if that matters.

Edited by theDrell

So, restarted my server without this plugin installed.  And My cache drives disappeared again.  Not sure what is causing this, I will go search elsewhere.

 

Just found where if you use Chrome the cache drives can disappear on restart.  Sorry guys, it just correlated perfectly to this plugin install twice.

Edited by theDrell

2 hours ago, theDrell said:

Just found where if you use Chrome the cache drives can disappear on restart.  Sorry guys, it just correlated perfectly to this plugin install twice.

Do you have any adblockers? You should whitelist your server.

17 minutes ago, trurl said:

Do you have any adblockers? You should whitelist your server.

I do, I have tried several browsers now, and even tried from the UnRaid GUI.  That is not the problem actually.  It appears that using the reboot action completely drops my cache drives and they don't even show up in the unassigned devices.  I then have to do a power down and a cold start, and then reassign them to the cache.  However a power down and then pressing the power button seems to work just fine instead of the reboot.

17 minutes ago, theDrell said:

I do, I have tried several browsers now, and even tried from the UnRaid GUI.  That is not the problem actually.  It appears that using the reboot action completely drops my cache drives and they don't even show up in the unassigned devices.  I then have to do a power down and a cold start, and then reassign them to the cache.  However a power down and then pressing the power button seems to work just fine instead of the reboot.

Sounds like some sort of hardware issue where something isn't getting re-initialized on a warm start but does on a cold start.

23 hours ago, trurl said:

Sounds like some sort of hardware issue where something isn't getting re-initialized on a warm start but does on a cold start.

Moved my problem to this thread since it isnt a plugin problem.

 

 

So I let me start with - I love this plugin! It's fantastic for some various tasks. Recently I've been exploring some options with UPS activity and in many cases it involves running another service/daemon to just run a script. I was thinking it might be great if I could just do so from unRAID instead of setting up individual installs. 

 

Would it be possible and/or is it feasible to extend this plugin to allow for another drop-down option for the schedule to happen on power-loss or power-restore from the UPS? Assuming of course unRAID is powered on, I'd love to be able to kick off the shutdown scripts for example that I'd be sending to my ESXi boxes, my Rock64, an extraneous piece of network equipment, etc. 

  • 3 weeks later...

I have a bash script in a share that I want to run on a cron schedule.

/mnt/user/odin_backup/OdinBackUp/odin_backup.sh

Is there some way to use this plg to run the script?

44 minutes ago, wgstarks said:

I have a bash script in a share that I want to run on a cron schedule.


/mnt/user/odin_backup/OdinBackUp/odin_backup.sh

Is there some way to use this plg to run the script?

Nevermind. I think I figured it out. This seems to be working-

cd /mnt/user/odin_backup/OdinBackUp && bash odin_backup.sh

 

  • 3 weeks later...

Hi

 

I am looking to do something very simple. I want a user script which restarts a docker container, lets say Transmission when run.

 

So I went to the user scripts GUI, clicked on add script and created a new script. I named it 'restart transmission' and saved. Then I went to edit and added the line 


 

restart docker transmission

and saved the file

 

So the script file now reads 


 

#!/bin/bash

docker restart transmission

 

But when I run the script nothing happens, a blank window just opens. I am able to get the desired result by issuing this command from command line however. What am I missing?

 

6 minutes ago, extremeaudio said:

Hi

 

I am looking to do something very simple. I want a user script which restarts a docker container, lets say Transmission when run.

 

So I went to the user scripts GUI, clicked on add script and created a new script. I named it 'restart transmission' and saved. Then I went to edit and added the line 


 


restart docker transmission

and saved the file

 

So the script file now reads 


 


#!/bin/bash

docker restart transmission

 

But when I run the script nothing happens, a blank window just opens. I am able to get the desired result by issuing this command from command line however. What am I missing?

 

 

docker stop transmission
docker start transmission

 

  • Author
2 minutes ago, extremeaudio said:

a blank window just opens

Is the window completely blank?  Or is there a message in there about the script location etc.

Thanks. That works.

8 minutes ago, Squid said:

Is the window completely blank?  Or is there a message in there about the script location etc.

I realize the window was blank because some other user script was running. After I stopped the other running script and ran this again, I got some info in the window. So basically even the 'restart' command works. Just that I needed to wait till the other script finishes.

Edited by extremeaudio

Getting "cat: write error: Broken pipe" when booting unraid with this plugin installed. I have not installed any scripts yet.

I see "Fix broken pipe" in the release notes but, yeah. I still see it. ;) Don't know if it has any ill-effects.

Edited by Niklas

  • Author

It doesn't

Sent from my SM-A530W using Tapatalk

21 minutes ago, Niklas said:

Getting "cat: write error: Broken pipe" when booting unraid with this plugin installed. I have not installed any scripts yet.

I see "Fix broken pipe" in the release notes but, yeah. I still see it. ;) Don't know if it has any ill-effects.

You're not alone 🙂

So, running 6.4.1 and the AppleDouble and DS_Store scripts run but the files are still there (even after a reboot) is there something about the scripts and spaces in the directory names (ie. - Media)?

 

My bad.. I just added a script for dot_clean files.. Didnt work though just used ._* for the "name" variable

Edited by HarshReality

ok i think i might just be really bad but well... i tried a lot of command to launch the preview:generate-all of the occ for nextcloud and i cant find anything working... the best i got is from that line 

sudo -u nobody php /mnt/cache/appdata/nextcloud/www/nextcloud/occ preview:generate-all -vvv

 

but then i got a connection error..... 

Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /mnt/cache/appdata/nextcloud/www/nextcloud/lib/private/DB/Connection.php:64

 

i know that nexcloud is connected to a mariadb database but i cant seems to be able to connect to it either :(

and yes i tried things like that

docker exec -it nextcloud bash 

sudo -u abc php /config/www/nextcloud/occ  preview:generate-all -vvv

(the normal command i can use when im in the console view of the docker)

 

so any hint would be nice if possible and else but still thanks caus im pretty sure that when ill find how this thing work it will be nice :P

 

 

Hi, 

First off, this plugin is awesome!

Hopefully this is the right place for a feature request:

I'd like to have a script run on startup/reboot of the server after Docker has finished starting up. The script starts a VM.

My workaround:

#!/bin/bash
sleep 240 && virsh start uuid-of-vm

I figure that the "At Startup Of Array" schedule in User Scripts would work; however, it is executed when the array BEGINS starting up and not when the array has COMPLETED starting up. Sure, I can increase the sleep interval to a longer time period but as the array gets larger and I add more containers/VMs, the sleep time would have to be adjusted.

TL;DR Can more schedule options be added like: "Array Startup", "Array Startup Complete", "Docker Startup", "Docker Startup Complete", "VMs Startup", "VMs Startup Complete". 

For now, is there something I can add to the script that would allow it to run after a certain docker container has (or all docker containers have) started?

Thanks!

Every 20 minutes syslog records the following error:

 

Oct 30 11:23:01 MediaNAS crond[1943]: failed parsing crontab for user root: #015
Oct 30 11:43:02 MediaNAS crond[1943]: failed parsing crontab for user root: #015
Oct 30 12:04:01 MediaNAS crond[1943]: failed parsing crontab for user root: #015
Oct 30 12:24:01 MediaNAS crond[1943]: failed parsing crontab for user root: #015
Oct 30 12:44:02 MediaNAS crond[1943]: failed parsing crontab for user root: #015

 

This all started with a script I created in User Scripts which I ended up deleting.  However, deleting it from User Scripts did not clean up the problem (It used to show the name of the deleted script in the error).  I tried to do some manual cleanup in custom.Schedule.cron and schedule.json to remove all references to the deleted script, but, something, somewhere is still referencing a script that no longer exists and is producing this error, although no longer by name.

 

Any ideas where to look?

  • Author

After editing the custom.Schedule.cron file, 

update_cron

You found a bug where it doesn't update that file if you delete a script that runs on a custom schedule.  (It does update it if you disable the schedule)

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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.