[Plugin] CA User Scripts


Recommended Posts

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

Link to comment

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
Link to comment
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).

Link to comment
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

Link to comment
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
Link to comment
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.

  • Like 1
Link to comment

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 ?

Link to comment
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.

  • Thanks 1
Link to comment
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

Link to comment
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?

Link to comment

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.

Link to comment
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.

Link to comment

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

 

Link to comment
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.

Link to comment

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

 

 

Link to comment
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
Link to comment

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
Link to comment

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.