[Plugin] CA User Scripts


1236 posts in this topic Last Reply

Recommended Posts

Hi All,

 

I'm using the user scripts plugin to run a custom script every 5 minutes. I've set it up via the GUI, and I provided "*/5 * * * " in the custom field and applied the changes. However, I don't think my script is running every 5 minutes (I'm looking for a log file the script writes to and the log file doesn't get updated with the right timestamps). Am I missing any final steps to run the script periodically? /etc/cron.d/root file does seem to have an entry for my script....

 

Thanks!

Link to post
  • Replies 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Just a simple little plugin to act as a front end for any little scripts that you may have that you may need to run every once in a while, and don't feel like dropping down to the command line to do i

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

@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

@Squid

 

Would be nice to have some code or maybe a built in function of the Plugin to backup/restore all scripts. I've massed several of them and well it would really be disappointing if I messed up and lost them all. Maybe part of the Backup/Restore Plugin we all love. 😀Yes I know they are originally saved on the Flash Drive, but you always do things so much more Elegant. 

 

Just in case your board and have nothing else to work on. Lol

Link to post
Just now, Squid said:

Technically it already does via the USB backup part.

 

Ok now I feel kinda dumb. Lol

I'm at sick at home with a Fever playing on unraid.net lol 

 

I think I should go back to bed. Thanks @Squid for all the awesome stuff you do. 

Link to post
On 2/23/2019 at 8:16 PM, Cessquill said:

There may be a valid reason why this is not done already, but if you edit the name of the script, could it also update the name of the corresponding folder in the user.scripts\scripts directory?

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 still doesn't do it is pure laziness

Link to post
12 hours ago, Squid said:

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 still doesn't do it is pure laziness

That's the spirit!

 

Some of my projects at work have more comment than code.

Link to post

I have a Daily DVR Section on my plex server.  It records the OTA Daily TV shows but they way plex is setup it keeps shows until its watched and then deleted.  

I don't know how to script but looking for someone to create a script.  I want this to run at midnight and I wanted to delete all video files older than 24hours or have it flagged as watched and plex will delete automatically. 

Link to post

I'm having a strange issue. All my schedules somehow got set to disabled and when i try to re-enable the schedule, i can't press "Apply". Nothing happens. If i go back to the page, it's all disabled again. I've tried different browsers and have rebooted several times (for other reasons) and it's still not working. The scripts work fine if run manually. I've tried removing and re-adding the user scripts plugin, didn't help.

Link to post
I'm having a strange issue. All my schedules somehow got set to disabled and when i try to re-enable the schedule, i can't press "Apply". Nothing happens. If i go back to the page, it's all disabled again. I've tried different browsers and have rebooted several times (for other reasons) and it's still not working. The scripts work fine if run manually. I've tried removing and re-adding the user scripts plugin, didn't help.
Post your diagnostics

Sent via telekinesis

Link to post

My script file is a python script, but it keeps failing because python decides to use ANSII instead of UTF-8. It turns out that the LANG environment variable is not being set to en_US.UTF-8. Any ideas how I could fix that without having a boiler plate shell script?

Edited by UntouchedWagons
Link to post
2 hours ago, UntouchedWagons said:

My script file is a python script, but it keeps failing because python decides to use ANSII instead of UTF-8. It turns out that the LANG environment variable is not being set to en_US.UTF-8. Any ideas how I could fix that without having a boiler plate shell script?

https://forums.unraid.net/topic/48286-plugin-ca-user-scripts/?page=25&tab=comments#comment-720270

 

Link to post
1 hour ago, Squid said:

What is the output of


ls -ail /boot/config/plugins/user.scripts/scripts/

 

4041 drwxrwxrwx 14 root root 8192 Mar 12 16:24 ./
4039 drwxrwxrwx  3 root root 8192 Jan 16 05:43 ../
5133 drwxrwxrwx  2 root root 8192 Nov 18 18:57 USB\ HotPlug/
5105 drwxrwxrwx  2 root root 8192 Nov 18 18:57 apcupsd?.sh/
5109 drwxrwxrwx  2 root root 8192 Nov 18 18:57 clear\ an\ array\ drive/
5115 drwxrwxrwx  2 root root 8192 Nov 18 18:57 delete.ds_store/
5112 drwxrwxrwx  2 root root 8192 Nov 18 18:57 delete_dangling_images/
5118 drwxrwxrwx  2 root root 8192 Mar  1 23:23 duplicacy\ install/
5124 drwxrwxrwx  2 root root 8192 Nov 18 18:57 icon\ sync/
5121 drwxrwxrwx  2 root root 8192 Nov 18 18:57 icon_banner\ downloader/
5127 drwxrwxrwx  2 root root 8192 Nov 18 18:57 move\ array\ only\ shares/
5130 drwxrwxrwx  2 root root 8192 Nov 18 18:57 move\ cache\ only\ shares/
5135 drwxrwxrwx  2 root root 8192 Nov 18 18:57 viewDockerLogSize/
5138 drwxrwxrwx  2 root root 8192 Nov 18 18:57 vm\ settings\ backup/

 

Link to post
31 minutes ago, Squid said:

I think that's messing it up  Rename or move elsewhere

Nice. that worked. Not sure how that happened. Isn't apcupsd one of the default scripts you include? i might have added it myself a long time ago. Ah well. works now. Thanks!

Link to post

Want to use CA to download a gz file, extract it to TVheadend and change name. I try this Linux command but it fail:

The first string execute this error:

wget webblink /mnt/user/appdata/tvheadend/data/: Scheme missing.

 

Edited by stormense
exam
Link to post

Feeling like a huge idiot! I have 2 unraid servers. One on 6.6.6 one on 6.3.5. I found and installed User Scripts in the 6.6.6 but when I search CA for "User Scripts" in the 6.3.5 machine I get "No Matching Content Found" but if I search just "User" I get 21 results none of which are the right one. What gives?

 

I did manage to install it manually using the URL, someone tell me this is either very weird or very common.

Edited by Adriano90
Solved...kinda
Link to post
21 minutes ago, Adriano90 said:

6.3.5.

Since your server is 6.3.5, you are running a very old version of CA which is using an outdated and unreliable application feed that doesn't even have 1/10th of the apps available.  CA has required 6.4+ for quite a while now and the URLs for the feed changed a long time ago.  Update your server and CA

Link to post
26 minutes ago, Squid said:

Since your server is 6.3.5, you are running a very old version of CA which is using an outdated and unreliable application feed that doesn't even have 1/10th of the apps available.  CA has required 6.4+ for quite a while now and the URLs for the feed changed a long time ago.  Update your server and CA

Was planning on updating after a backup which I was trying to use the script to do (JUST IN CASE). Thanks for the help!

Link to post

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.