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

I am trying user scripts to shutdown my server at night.

 

Would these lines work?

 

#!/bin/bash

powerdown | at 01:30

 

Should the powerdown plugin be installed, or is this functionality now included in unraid 6.3.5?

 

  • 2 weeks later...
  • Replies 2.1k
  • Views 567.7k
  • 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

  • Author
On 8/1/2017 at 9:37 AM, dikkiedirk said:

I am trying user scripts to shutdown my server at night.

 

Would these lines work?

 

#!/bin/bash

powerdown | at 01:30

 

Should the powerdown plugin be installed, or is this functionality now included in unraid 6.3.5?

 

Should work.  Or simply 

#!/bin/bash

powerdown

And set the schedule to run when you want.

Is there any reason the delete.ds_store script wouldn't actually delete all the .ds_store files? Tried it last night after Fix Common Problems found a bunch of duplicate .ds_store files spanning pretty much all of my shares. I disabled the creation of .ds_store files on my Macs, ran the user script, then ran the Fix Common Problems extended test again. Still had many, many dupes. So I went through and manually deleted them.

 

Just curious if I did something wrong, or that script perhaps needs an update. Thanks!

  • Author
36 minutes ago, kaiguy said:

Is there any reason the delete.ds_store script wouldn't actually delete all the .ds_store files? Tried it last night after Fix Common Problems found a bunch of duplicate .ds_store files spanning pretty much all of my shares. I disabled the creation of .ds_store files on my Macs, ran the user script, then ran the Fix Common Problems extended test again. Still had many, many dupes. So I went through and manually deleted them.

 

Just curious if I did something wrong, or that script perhaps needs an update. Thanks!

No reason that I can think of.  I don't really support the scripts (even the default included).  They're just samples

On ‎8‎/‎16‎/‎2017 at 2:47 AM, Squid said:

Should work.  Or simply 

 


#!/bin/bash

powerdown

 

And set the schedule to run when you want.

how do I schedule this at 11:30 or 00:30? what is the correct cron syntax for this? the online generator doesn't seem to work.

Edited by dikkiedirk

  • Author
20 minutes ago, dikkiedirk said:

how do I schedule this at 11:30 or 00:30?

30 23 * * *

 

30 0 * * *

thanks, I just googled it. shame on me, always asking. and its working. thanks!

2 hours ago, dikkiedirk said:

thanks, I just googled it. shame on me, always asking. and its working. thanks!

 

Best site ever.

http://corntab.com/

15 minutes ago, Squid said:

Same site that's linked to in user scripts

 

EDIT:  Albeit user scripts goes to http://www.corntab.com which used to work.  Now it doesn't.  Only http://corntab.com works

 

Yep I know it is. That's how I found it. ;-)

When running a user script manually, does it run as a different user versus being run via a schedule?

  • Author
When running a user script manually, does it run as a different user versus being run via a schedule?
Everything should run as root

Sent from my LG-D852 using Tapatalk

Hmm, that's what I thought but I seem to get different results depending on how the script is initiated.

  • Author
Hmm, that's what I thought but I seem to get different results depending on how the script is initiated.
Explain...

Admittedly I have never checked what user a cron entry runs as though

Sent from my LG-D852 using Tapatalk

I had a script that ran the rc.unassigned script from the unassigned drivers plugin. The path to is something like /usr/local/plugins. This works fine if I manually kick the script off but fails when the script runs via a schedule, it claims the path doesn't exist.

  • Author

Shouldn't make any difference.  But, you have to bear in mind that all paths anywhere in a script should be absolute, and not relative.  That, and IIRC (would have to double check after work), but the scripts have slightly different /tmp folders that they execute from depending upon how its started.

I am using the vm backup script, is there anyway to schedule what time it runs? I don't see any option to schedule a time for it? Also is there any option to delete older backups?

 

thanks

  • Author
4 hours ago, ozkhan1 said:

I am using the vm backup script, is there anyway to schedule what time it runs? I don't see any option to schedule a time for it? Also is there any option to delete older backups?

 

thanks

Assuming you're running the autovmbackup scripts.  That, (and any script) run through User Scripts can be scheduled via the Schedule setting next to the script.

On 6/26/2016 at 10:50 PM, Squid said:

Assuming you're running the autovmbackup scripts.  That, (and any script) run through User Scripts can be scheduled via the Schedule setting next to the script.

 
0

 

Sent from my LG-D852 using Tapatalk

 

 

i can schedule it but it doesnt allow me to pick days/dates/times etc.. i get a drop down for picking weekly/daily/monthly etc and when i click apply, it says schedule applied.

perhaps i need to choose the custom schedule?  if so will you be kind enough to provide the guidelines around the format it expects the information in?

 

Edited by ozkhan1

  • Author

http://corntab.com or search for cron on wikipedia . or hover over the what is cron link on the bottom left

Sent from my LG-D852 using Tapatalk

I have been having an issue where I use rsync, via User Scripts, to perform backups to a remote server and that would make the webGUI unresponsive until the task was completed. Strange thing is I can run the rsync task via shell and I do not have any issues not being able to use the webGUI. Any idea why this is occurring?

  • Author
I have been having an issue where I use rsync, via User Scripts, to perform backups to a remote server and that would make the webGUI unresponsive until the task was completed. Strange thing is I can run the rsync task via shell and I do not have any issues not being able to use the webGUI. Any idea why this is occurring?
If you're running the script in the foreground perfectly normal. If you're running it in the background no idea

Sent from my LG-D852 using Tapatalk

If you're running the script in the foreground perfectly normal. If you're running it in the background no idea

Sent from my LG-D852 using Tapatalk

It happens when I run it in the background. It's just strange that it only occurs when using the plug-in.

Sent from my XT1575 using Tapatalk

  • Author
23 minutes ago, osker246 said:

It happens when I run it in the background. It's just strange that it only occurs when using the plug-in.

Sent from my XT1575 using Tapatalk
 

Are you using one of the built-in schedules or a custom cron?

2 minutes ago, Squid said:

Are you using one of the built-in schedules or a custom cron?

Custom cron. 

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.