March 13, 20179 yr So should it look like this #!/bin/bash echo "Searching for (and deleting) .DS_Store Files" echo "This may take a awhile" find /mnt/user -maxdepth 9999 -noleaf -type f -name ".DS_Store" -exec rm "{}" \; #!/bin/bash echo "Searching for (and deleting) .AppleDB" echo "This may take a awhile" find /mnt/user -maxdepth 9999 -noleaf -type f -name ".AppleDB" -exec rm "{}" \; Edited March 13, 20179 yr by squirrellydw
March 13, 20179 yr Author On 3/5/2017 at 10:07 PM, tmchow said: Having a weird issue using the "description" variable. In the Clean Docker Logs script, I killed the description file and moved it to a variable with this as the first line of the script: #description=Clean up docker log sizes on your system However, this doesn't work and the user scripts UI tells me no description is present I removed one word at a time to see what was breaking it, and it wasn't until I removed the words "on your system" that it worked: #description=Clean up docker log sizes This isn't about line length since other scripts I'm using descriptions that are much longer, such as #description=This script will display the size of your docker logs, so you can see if runaway logging is contributing to your docker.img file filling up What am I missing? Fixed
March 13, 20179 yr Author 5 hours ago, squirrellydw said: So should it look like this #!/bin/bash echo "Searching for (and deleting) .DS_Store Files" echo "This may take a awhile" find /mnt/user -maxdepth 9999 -noleaf -type f -name ".DS_Store" -exec rm "{}" \; #!/bin/bash echo "Searching for (and deleting) .AppleDB" echo "This may take a awhile" find /mnt/user -maxdepth 9999 -noleaf -type f -name ".AppleDB" -exec rm "{}" \; Yeah, that'll work. Technically, you only require the first #!/bin/bash though....
March 13, 20179 yr 1 minute ago, Squid said: Yeah, that'll work. Technically, you only require the first #!/bin/bash though.... And just to nitpick, it should be "This may take a while". Not that it'll make any difference how the script runs.
March 14, 20179 yr So this is what I have, do I need to change any of the other files? #!/bin/bash echo "Searching for (and deleting) .DS_Store Files" echo "This may take a while" find /mnt/user -maxdepth 9999 -noleaf -type f -name ".DS_Store" -exec rm "{}" \; echo "Searching for (and deleting) ._.DS_Store Files" echo "This may take a while" find /mnt/user -maxdepth 9999 -noleaf -type f -name “._.DS_Store" -exec rm "{}" \; echo "Searching for (and deleting) .AppleDB Files" echo "This may take a while" find /mnt/user -maxdepth 9999 -noleaf -type f -name “.AppleDB” -exec rm "{}" \; echo "Searching for (and deleting) .AppleDesktop Files" echo "This may take a while" find /mnt/user -maxdepth 9999 -noleaf -type f -name “.AppleDesktop” -exec rm "{}" \; echo "Searching for (and deleting) .AppleDouble Files" echo "This may take a while" find /mnt/user -maxdepth 9999 -noleaf -type f -name “.AppleDouble” -exec rm "{}" \; echo "Searching for (and deleting) .TemporaryItems Files" echo "This may take a while" find /mnt/user -maxdepth 9999 -noleaf -type f -name “.TemporaryItems” -exec rm "{}" \;
March 14, 20179 yr Better would be: 1 hour ago, squirrellydw said: #!/bin/bash echo "This may take a while" echo "Searching for (and deleting) .DS_Store Files" find /mnt/user -maxdepth 9999 -noleaf -type f -name ".DS_Store" -exec rm "{}" \; echo "Searching for (and deleting) ._.DS_Store Files" find /mnt/user -maxdepth 9999 -noleaf -type f -name "._.DS_Store" -exec rm "{}" \; echo "Searching for (and deleting) .AppleDB Files" find /mnt/user -maxdepth 9999 -noleaf -type f -name ".AppleDB" -exec rm "{}" \; echo "Searching for (and deleting) .AppleDesktop Files" find /mnt/user -maxdepth 9999 -noleaf -type f -name ".AppleDesktop" -exec rm "{}" \; echo "Searching for (and deleting) .AppleDouble Files" find /mnt/user -maxdepth 9999 -noleaf -type f -name ".AppleDouble" -exec rm "{}" \; echo "Searching for (and deleting) .TemporaryItems Files" find /mnt/user -maxdepth 9999 -noleaf -type f -name ".TemporaryItems" -exec rm "{}" \; And I'm sure a bash scripter could shorten it with a loop, working on a list. Edited March 14, 20179 yr by RobJ improve wording
March 14, 20179 yr I just ran this and I don't see the files but I still see some Folders with the same name, any idea how I can delete them?
March 14, 20179 yr 9 hours ago, squirrellydw said: I just ran this and I don't see the files but I still see some Folders with the same name, any idea how I can delete them? For folders/directories, I believe you would use -type d instead of -type f.
March 14, 20179 yr #!/bin/bash echo "This may take a while" echo "Searching for (and deleting) Apple Netatalk Files/Directories" find /mnt/user -maxdepth 9999 -noleaf \( -type f \( -name ".DS_Store" -o -name "._.DS_Store" \) -o -type d \( -name ".AppleDB" -o -name ".AppleDesktop" -o -name ".AppleDouble" -o -name ".TemporaryItems" \) \) -exec rm -r "{}" \; this should be much quicker. (only has to search one time through all directories.) after deleting a directory, there can be an error message (because the find wants to search inside the directory but it doesn't exist anymore... Edited March 14, 20179 yr by Benni-chan
March 16, 20179 yr Author Added in support for a new schedule "At first array start" -> Still executes at array start, but will only execute once (ie: Will not execute again if you stop and restart the array). Solves a problem for me where I kept on getting recursive symlinks getting created with every stop and start on one of my scripts Edited March 16, 20179 yr by Squid
March 16, 20179 yr 41 minutes ago, Squid said: Added in support for a new schedule "At bootup only" -> Still executes at array start, but will only execute once (ie: Will not execute again if you stop and restart the array). It's a good option, but I think you will get complaints from some who actually want a true "At boot" option. Might be better to call it something like "On first array start only". Perhaps you can add a note that currently a true "at boot" option probably has to use the go file.
March 16, 20179 yr Author Fixed wording. Tell you what though... I'll add in a true at boot this weekend... It'll execute during plugin install. Later than you can do things in the go file, but still before array start Edited March 16, 20179 yr by Squid
March 16, 20179 yr I suspect you are going to get some love for that! But you'll have to tell them that since the array isn't running yet, there aren't many services running. Other than the boot drive, there are no storage devices available. And networking could be unreliable, as it gets reconfigured on array start. I think I would want to add a note with it, that the feature is there but you aren't providing support for its use!
March 16, 20179 yr Author Just now, RobJ said: I suspect you are going to get some love for that! But you'll have to tell them that since the array isn't running yet, there aren't many services running. Other than the boot drive, there are no storage devices available. And networking could be unreliable, as it gets reconfigured on array start. I think I would want to add a note with it, that the feature is there but you aren't providing support for its use! I don't support any script here lol.... I'll add appropriate warnings...
March 18, 20179 yr Author On 3/15/2017 at 11:53 PM, RobJ said: I suspect you are going to get some love for that! But you'll have to tell them that since the array isn't running yet, there aren't many services running. Other than the boot drive, there are no storage devices available. And networking could be unreliable, as it gets reconfigured on array start. I think I would want to add a note with it, that the feature is there but you aren't providing support for its use! Thought about all of this, and I'm not going to do it. Not because its hard (its not), but simply because if the script has errors, or goes haywire or something, diagnosis on startup issues would be a royal pain to diagnose. Any user who is capable enough to want to run a particular script at actual startup would also be capable enough to edit the go file themselves.
April 3, 20179 yr argumentDescription if present this will bring up a pop up asking the user for the argument list for the script. Note that currently arguments do not accept spaces contained within one argument (ie: quoting and escaping spaces does NOT work) argumentDefault this is the default arguments for the above These options don't seem to be working after I upgraded to 6.3.3. Can anyone confirm or tell me if I did something wrong? Here's the start of my script: #!/bin/bash #description=description #arrayStarted=true #argumentDescription=Enter arguments #argumentDefault=p1 p2 echo
April 4, 20179 yr Hi @Squid I was wondering if in a future release of user scripts that you would consider making an edit script button to edit existing scripts. I find it a pain to have to open the flash then edit the script from there. Especially with my rare disease of "extremus-lazy-itus"
April 5, 20179 yr Author On 4/3/2017 at 11:44 AM, rbronco21 said: argumentDescription if present this will bring up a pop up asking the user for the argument list for the script. Note that currently arguments do not accept spaces contained within one argument (ie: quoting and escaping spaces does NOT work) argumentDefault this is the default arguments for the above These options don't seem to be working after I upgraded to 6.3.3. Can anyone confirm or tell me if I did something wrong? Here's the start of my script: #!/bin/bash #description=description #arrayStarted=true #argumentDescription=Enter arguments #argumentDefault=p1 p2 echo You're doing it right. You found a regression error of mine after the last update. Fixed.
April 5, 20179 yr 14 hours ago, Squid said: You're doing it right. You found a regression error of mine after the last update. Fixed. Works for me now. Thanks for the help.
April 6, 20179 yr Author On 4/4/2017 at 5:02 AM, gridrunner said: Hi @Squid I was wondering if in a future release of user scripts that you would consider making an edit script button to edit existing scripts. I find it a pain to have to open the flash then edit the script from there. Especially with my rare disease of "extremus-lazy-itus" On 7/6/2016 at 4:01 PM, Bjonness406 said: Maybe a button to add new script aswell if you do this Squid On 7/6/2016 at 2:02 PM, MyKroFt said: Suggestion.... how about a button to edit via simple web text field the description/script after they have been added. Just a simple form with 2 text boxes, one for the desc and one for the script? Thanks Myk OK.... If you're running unRaid 6.3.3+, Hovering over a scripts name will bring up a couple of options: Edit Name, Edit Description, Edit Script, and Delete Script Edit name & description are both done in place, but Edit Script will open up a new spot at the bottom of the page where you can edit the script. Additionally, a new button will also exist to Add a new script.
April 6, 20179 yr 12 hours ago, Squid said: OK.... If you're running unRaid 6.3.3+, Hovering over a scripts name will bring up a couple of options: Edit Name, Edit Description, Edit Script, and Delete Script Edit name & description are both done in place, but Edit Script will open up a new spot at the bottom of the page where you can edit the script. Additionally, a new button will also exist to Add a new script. Thanks, @Squid I was was so excited I found I hit the donate button and just bought you a beer!!
April 6, 20179 yr Author Thanks, [mention=10290]Squid[/mention] I was was so excited I found I hit the donate button and just bought you a beer!! [emoji3]Thanks for that buddy... 6.3.3 is giving me new tools to make things easier on the ui Sent from my LG-D852 using Tapatalk
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.