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

On 6/8/2022 at 8:05 AM, CBPXXIV said:

I'm having a weird issue.  I have strips installs, did it a while back and put some scripts in place.  Just went in to settings cause I wanted to check one of them and there is no icon for me to click, it's like it's not installed on my system.  If I click on it from the plugins page just goes to /Settings/Userscripts, but it's a blank page.  Thoughts?  Are my scripts even still running or are they gone?

 

Screenshot 2022-06-07 200235.png

Screenshot 2022-06-07 200124.png

Screenshot 2022-06-07 200046.png

Same problem

 

On 6/8/2022 at 8:05 AM, CBPXXIV said:

I'm having a weird issue.  I have strips installs, did it a while back and put some scripts in place.  Just went in to settings cause I wanted to check one of them and there is no icon for me to click, it's like it's not installed on my system.  If I click on it from the plugins page just goes to /Settings/Userscripts, but it's a blank page.  Thoughts?  Are my scripts even still running or are they gone?

 

Screenshot 2022-06-07 200235.png

Screenshot 2022-06-07 200124.png

Screenshot 2022-06-07 200046.png

blank page

  • Replies 2.1k
  • Views 567.5k
  • 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

So I have been trying to set a Custom schedule for a script to run, but It never runs, I have used online Cron generators, (Several of them) and the schedule never seems to kick in.

 

I am looking to have the script run every 6 hours every day starting at midnight. This is what I have tried:

 

0 0 0/6 ? * * *

0 0 0/6 * * * *

* * 0/6 * * ? *

* * 0/6 * * * *

 

What is the correct way?

 

Note: Script runs correctly if set to schedule or ran manually

Edited by almulder

1 hour ago, almulder said:

So I have been trying to set a Custom schedule for a script to run, but It never runs, I have used online Cron generators, (Several of them) and the schedule never seems to kick in.

 

I am looking to have the script run every 6 hours every day starting at midnight. This is what I have tried:

 

0 0 0/6 ? * * *

0 0 0/6 * * * *

* * 0/6 * * ? *

* * 0/6 * * * *

 

What is the correct way?

 

Note: Script runs correctly if set to schedule or ran manually

As was mentioned - along the right lines, but the wrong number of fields (there should be 5).

My apply button is broken, i camt set any schedules. on 6.10.3

  • Author
On 6/10/2022 at 9:45 AM, TheBeast said:

Hey there
i got a problem on my unraid server (dell r710)
i cant set a schedule if i want i cant press apply but i cant press done but its do not save :/
want can i do ? any other have the same issue
image.thumb.png.57a57aadbaf40e31bc3eca1d4f03b4e4.png

Get rid of the % on the names

  • Author
1 hour ago, dGG2uA said:

My apply button is broken, i camt set any schedules. on 6.10.3

Look for special characters etc in the names

10 minutes ago, Squid said:

Look for special characters etc in the names

that was it, i had a "@". thanks :)

1 hour ago, itimpi said:

As was mentioned - along the right lines, but the wrong number of fields (there should be 5).

when will the first run happen? as I expected it to at noon today, and nothing happened. (Current Unraid Server Time 12:43pm)

 

I have changed the cron to be "0 13/6 * * *" witch means it should do the run starting at 1pm (17 mins, so I guess I will see if it runs)

 

update: it did not run at 1pm. what am I doing wrong?

Edited by almulder

I changed the cron back to

0 0/6 * * *

Last night, and it never ran, I have to run it manually.

Are cron's custom schedule working for anyone else. regardless of things I try they never run on a custom cron. 

2 minutes ago, almulder said:

Are cron's custom schedule working for anyone else. regardless of things I try they never run on a custom cron. 

I have several set up and they all run fine.

7 minutes ago, almulder said:

I changed the cron back to

0 0/6 * * *

Last night, and it never ran, I have to run it manually.

Are cron's custom schedule working for anyone else. regardless of things I try they never run on a custom cron. 

Give

0 */6 * * * 

a go.  Might not give you a definite start hour, but might help identify the issue.  I have custom schedules working, but I've never quite worked out which rules of cron apply.

hello there's a bug in this plugin, when i put the character @ in a script name i can't interact on the script anymore, nor modify or delete the script, it's frozen !

 

I've made a new script named "Remove @eaDir from video_data", now i can't do anything on this script !
Someone know how to unlock the situation ?

17 minutes ago, doobyns said:

hello there's a bug in this plugin, when i put the character @ in a script name i can't interact on the script anymore, nor modify or delete the script, it's frozen !

 

From the first post...

 

Quote

The name doesn't matter but it can only contain the following characters: letters ([A-Za-z]), digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), periods ("."), and spaces (" ")

 

Possible fix to get it back going again...

 

  • On your Unraid flash drive, go to \config\plugins\user.scripts\scripts
  • Rename the folder in question that applies to your script
  • Inside that folder, edit the "name" file to repair the title
  • Refresh the User Scripts page in your browser

Or, just delete that folder and start again.

On 6/17/2022 at 1:30 PM, Cessquill said:

Give

0 */6 * * * 

a go.  Might not give you a definite start hour, but might help identify the issue.  I have custom schedules working, but I've never quite worked out which rules of cron apply.

Not sure why but that worked and does start and midnight and ran every 6 hours. Thanks

On 6/7/2022 at 8:05 PM, CBPXXIV said:

I'm having a weird issue.  I have strips installs, did it a while back and put some scripts in place.  Just went in to settings cause I wanted to check one of them and there is no icon for me to click, it's like it's not installed on my system.  If I click on it from the plugins page just goes to /Settings/Userscripts, but it's a blank page.  Thoughts?  Are my scripts even still running or are they gone?

 

Screenshot 2022-06-07 200235.png

Screenshot 2022-06-07 200124.png

Screenshot 2022-06-07 200046.png

Anyone?

Is it possible to execute a script with a custom cron job on the first Friday of every month? I tried to set the custom schedule to '0 0 23 ? * 6#1 *' but that doesn't work. I get this error.

 

Quote

crond[1247]: failed parsing crontab for user root: ? * 6#1 * /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/rboWakeServersAndStartSync/script > /dev/null 2>&1

 

PS The link in the help text "What is Cron" for the online generator doesn't work.

3 hours ago, rbojanssen said:

Is it possible to execute a script with a custom cron job on the first Friday of every month? I tried to set the custom schedule to '0 0 23 ? * 6#1 *' but that doesn't work. I get this error.

 

 

PS The link in the help text "What is Cron" for the online generator doesn't work.

There are too many fields - there should be 5 :(  I suspect that one of the * at the start is not what you want.   Also not sure if ? Is a valid option - I suspect you want * there instead.  Note also that Friday is day 5 not day 6.  Never tried the #1 qualifier so no idea if it works.

how do i write an if statement

 

to check if a drive is existant or not..

 

i use a scrip to copy music to a hard drive..   but if the hard drive isnt plugged in  i get the error.. but  i guess it makes a directory  in the unnassigned drives.. as Krusader sees the Drives  even though they dont exists..  i guess makes a temp folder or so so unraid thinks the drive is there and it isnt..

 

so id like a IF statement

 

if Drive is there 

copy files

if not exit if

 

  • Author
1 hour ago, comet424 said:

how do i write an if statement

 

to check if a drive is existant or not..

 

i use a scrip to copy music to a hard drive..   but if the hard drive isnt plugged in  i get the error.. but  i guess it makes a directory  in the unnassigned drives.. as Krusader sees the Drives  even though they dont exists..  i guess makes a temp folder or so so unraid thinks the drive is there and it isnt..

 

so id like a IF statement

 

if Drive is there 

copy files

if not exit if

 

Why not use the scripting available within Unassigned Devices that when the drive gets plugged in that it automatically copies the files to it.

the problem with that is  ya works  to an extent... but  when i work the bar... i have files that are updated... so if i were to plug in the in and mount it to auto run  it would over write

so how i do it i have 3 hard drives  2 i use 1 for back up

labeled   "music drive"  "1" "2" "3"  

and after the bar or so  i then plug the hard drive into server... and then i use krusader to copy back any changes to the one folder .. and if i were to use the auto scripting it would over write  thge files on the drive  ... so ud have to constantly  disable it

 

i do use the auto running script...  problem also  is once u reboot the server and the drives attached  u mount them auto sync.

 

like my script works for copying  i just find if the drive not in and script   does

mkdir  /unassigned drives/music drive 1/music       it makes a drive even though the drive isnt plugged in  krusader sees all the files but really they not there 

 

but i may re try the auto mount script..  i do use it for when i swap my sisters files  she lives a few hours away so she has me backup her files and meet her once a week..   so she shoves a ssd in  and it auto copies from a specific folder... so i really like the automount script for that....

 

figured an if statement was easy but i guess not lol

 

 

21 hours ago, itimpi said:

There are too many fields - there should be 5 :(  I suspect that one of the * at the start is not what you want.   Also not sure if ? Is a valid option - I suspect you want * there instead.  Note also that Friday is day 5 not day 6.  Never tried the #1 qualifier so no idea if it works.

 

I used the website https://www.freeformatter.com/cron-expression-generator-quartz.html to generate the Cron. I guess Cron isn't Cron.....?!?!?

 

Is it at al possible, with this version of cron, to run a job on the first Friday of each month?

Edited by rbojanssen

for some reason there is no way for me to see the show log or download the log for the user scripts when i run in the background:
image.thumb.png.b81e672251c6b866aad1024b2395ff6f.png

 

going to the path in the terminal, can see it:
/tmp/user.scripts/tmpScripts/ ... /log.txt

 

Any ideas?

 

Another issue is my drive is only going 5MB/s writes.... seems very slow

 

 

Edited by HynesJeff

Hi @Squid,

 

Thank you again for your wonderful plugin.

 

Here is my issue: Since upgrade to Unrid 6.10.2 it seems that "run in background" function does not work any more on my system.

 

When I click it, the usual popup "Now starting the script in the background' shows up, but after clicking "done", the script does not shows as "running" and the "view log", "download log" and "abort" button do not show up.

 

The paths to the scripts are as follows (with no puntuation):

/tmp/user.scripts/tmpScripts/unraid_fix-files-owner-and-permissions/script

/tmp/user.scripts/tmpScripts/unraid_backup-flash-to-mozart/script

 

Any idea on how to fix this ?

 

Many thanks,

 

OP

 

EDIT: It seems that scheduled scripts are not running either (i.e. when "At startup of the array" is selected from the dropdown menu).

 

.

Edited by Opawesome
Added another issue

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.