[Plugin] CA User Scripts


Recommended Posts

On 06/04/2017 at 2:59 AM, Squid said:

Edit Script will open up a new spot at the bottom of the page where you can edit the script.

 

I'm having a couple of issues with the editing feature, I'm not able to consistently reproduce them but both things happened more than once:

 

-after editing one scrip and canceling without any changes the previous script appears when I editing a different script

-the + is removed from one my scripts in the date variable, (date '+%Y%m%d') becomes (date ' %Y%m%d') in all instances in the script

 

If I find a way of consistently reproducing this I'll post again.

 

Link to comment
2 hours ago, johnnie.black said:

 

I'm having a couple of issues with the editing feature, I'm not able to consistently reproduce them but both things happened more than once:

 

-after editing one scrip and canceling without any changes the previous script appears when I editing a different script

-the + is removed from one my scripts in the date variable, (date '+%Y%m%d') becomes (date ' %Y%m%d') in all instances in the script

 

If I find a way of consistently reproducing this I'll post again.

 

 

Here's the consistent way to reproduce:

 

Edit a script, make a change, then cancel

Edit a different script.  The first script will still be there.  Fixed

 

The + sign thingy:  Fixed

  • Upvote 1
Link to comment
  • 2 weeks later...

Minor bug:

When you hover over the name of a script and click "edit name", the pop-up menu doesn't collapse automatically (like it does for the other options)

If you click on "edit name" again in this state, code snippets are being added to the name box. Each click adds more code.

Edited by Jorgen
spelling
Link to comment
7 hours ago, Jorgen said:

Minor bug:

When you hover over the name of a script and click "edit name", the pop-up menu doesn't collapse automatically (like it does for the other options)

If you click on "edit name" again in this state, code snippets are being added to the name box. Each click adds more code.

Good catch.  Fixed

  • Upvote 1
Link to comment
  • 2 weeks later...

Possible Bug, possible user error:

 

Was testing out rsync with this and made a super simplistic script called "rsync test". I told it to run in the background and had set it to run every minute while testing. When I got done testing, I deleted the script and forgot about it for a few days. Today I rebooted the server and later manually clicked mover, now every minute I have “Jun 2 16:45:01 YES-MEDIASERVER root: User Scripts: /boot/config/plugins/user.scripts/scripts/rsync test/script not found” popping up in the log file. Though, User Scripts no long has the script, so looks like it wasn’t completely removed.

 

 

EDIT:

Was mistaken, checked the actual sys log and found that it had been running ever since the reboot this morning. Found the cron job for the deleted script was still listed in...

/boot/config/plugins/user.scripts/customSchedule.cron

So it looks like when I deleted the script it didn't remove the cron entry.

Edited by ryoko227
Link to comment
3 hours ago, ryoko227 said:

Possible Bug, possible user error:

 

Was testing out rsync with this and made a super simplistic script called "rsync test". I told it to run in the background and had set it to run every minute while testing. When I got done testing, I deleted the script and forgot about it for a few days. Today I rebooted the server and later manually clicked mover, now every minute I have “Jun 2 16:45:01 YES-MEDIASERVER root: User Scripts: /boot/config/plugins/user.scripts/scripts/rsync test/script not found” popping up in the log file. Though, User Scripts no long has the script, so looks like it wasn’t completely removed.

 

 

EDIT:

Was mistaken, checked the actual sys log and found that it had been running ever since the reboot this morning. Found the cron job for the deleted script was still listed in...

/boot/config/plugins/user.scripts/customSchedule.cron

So it looks like when I deleted the script it didn't remove the cron entry.

The message was by design.  To let you know that the script wasn't found.  The plugin cannot update the cron when the script is manually deleted.  But, I now see how this can mess people up, especially with rapid cron schedules, so I've switched it to suppress the message.

Link to comment
The message was by design.  To let you know that the script wasn't found.  The plugin cannot update the cron when the script is manually deleted.  But, I now see how this can mess people up, especially with rapid cron schedules, so I've switched it to suppress the message.

It's sorted alphabetically by the folder name. Rename the folders as you choose then rename via the hover to whatever you want

Sent from my LG-D852 using Tapatalk

Link to comment
32 minutes ago, GreX said:

Hey, I need some help.

 

When I want to install the plugin I get error: plugin: bad file MD5

 

23 minutes ago, trurl said:

Possibly a bad download or maybe even a corrupt flash drive. Post diagnostics.

Nope.  Its my fault...  I did an update this morning and updated the md5, but forgot to update the version number.  My bad...  And I didn't even have a beer.  (But probably not enough coffee)  Should be good now...  

 

depression-treatment-centers.jpg

Link to comment
16 hours ago, Squid said:

The message was by design.  To let you know that the script wasn't found.  The plugin cannot update the cron when the script is manually deleted.  But, I now see how this can mess people up, especially with rapid cron schedules, so I've switched it to suppress the message.

Oh no worries Squid, I actually liked that the message was there. It let me know that something wasn't 100% on par. I was more curious if the plug-in was supposed to clear out the custom cron listing, or if I had borked something along the way, lol. Thank you for clearing that up for me though ^_^v

Link to comment
9 hours ago, ryoko227 said:

Oh no worries Squid, I actually liked that the message was there. It let me know that something wasn't 100% on par. I was more curious if the plug-in was supposed to clear out the custom cron listing, or if I had borked something along the way, lol. Thank you for clearing that up for me though ^_^v

The message was there for that reason.  But, after seeing what you did and then thinking about how you would stop the message from appearing, the solution was counter intuitive:  You would have to go into the plugin (the deleted script wouldn't be listed), and to stop the message you would have to make a change somewhere to the schedule for something else and apply those changes.

 

Makes more sense to simply suppress the message.

Link to comment
1 hour ago, dlandon said:

Can the icons on the right be lined up horizontally?

593d26f5d29d4_UserScripts.png.e81f26c6f1ef5ebd74d00d0c2ce2a110.png

Looks like its the same thing its the same thing as your dashboard bunching together issue, as it only happens on my system when the display is less than ~1100 px.  I'll wait to see what changes in the CSS happen on other versions.  (The blank space is reserved for the custom cron schedule)

Link to comment
30 minutes ago, Squid said:

Looks like its the same thing its the same thing as your dashboard bunching together issue, as it only happens on my system when the display is less than ~1100 px.  I'll wait to see what changes in the CSS happen on other versions.  (The blank space is reserved for the custom cron schedule)

That's weird.  I'm at 1280.

Link to comment
41 minutes ago, dlandon said:

That's weird.  I'm at 1280.

Can you change the below in the default-azure.css file (see styles folder)

#template{min-width:1080px;max-width:100%;margin:0}

to

#template{min-width:1280px;max-width:100%;margin:0}

Let me know if it improves your situation.

Link to comment
56 minutes ago, bonienl said:

Can you change the below in the default-azure.css file (see styles folder)


#template{min-width:1080px;max-width:100%;margin:0}

to


#template{min-width:1280px;max-width:100%;margin:0}

Let me know if it improves your situation.

No change.

Link to comment

From a PM...  Edited to remove certain details

 

Quote

Hi Squid, I've written a bash script that will xxxxxxxxxxxxxxx to the flash drive where unRAID 6.4 can use them:
(link removed)

 

It works fine when I run it in the background via the User Scripts, but I really need it to run when the array starts. Unfortunately, when I do that the array hangs until I kill the script's process.  

 

Is there a reason the User Scripts plugin isn't loading this in the background when I set it to run "at startup of array"? Could that be an option?

 

Thanks!

 

It's because of the inotifywait.

 

When running at array_start, the script has to finish.  In this case, the inotifywait sits there and waits for whatever trigger(s) you're setting, and the script won't complete until that trigger is hit.

 

What I would do is create another script set to run at array start.  And have that script set to call your script like this:

 

echo "/path/to/the/actual/script.sh" | at NOW -M > /dev/null 2>&1

This will create another background process that'll run the real script.

 

When manually running in the background, userscripts automatically does this.  The process is a little different during array_start/stop, and the hourly / daily / monthly schedules, and scripts run in order one at a time, and must execute to completion.

 

Edited by Squid
  • Upvote 1
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.