hernandito

Community Developer
  • Posts

    1482
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by hernandito

  1. HI Guys. I would like to create a new script that invokes the daily cache mover... but ONLY to move SPECIFIC folders from cache drive to the array. Specifically I want to move the files in /mnt/cache/Media/Movies. Is there a way to do this? I found what I believe is the mover script in /usr/local/sbin/mover - pasted code below. I was hoping to find something specific to /mnt/cache... but no luck. I confess I don't fully understand the script below. I am afraid of screwing things up in my array if I edit and run the wrong thing. I suspect the section that I would need to change is: # Check for objects to move from pools to array for POOL in /boot/config/pools/*.cfg ; do for SHAREPATH in /mnt/$(basename "$POOL" .cfg)/*/ ; do SHARE=$(basename "$SHAREPATH") if grep -qs 'shareUseCache="yes"' "/boot/config/shares/${SHARE}.cfg" ; then find "${SHAREPATH%/}" -depth | /usr/local/sbin/move -d $LOGLEVEL fi done done The line above that reads: "for SHAREPATH in /mnt/$(basename "$POOL" .cfg)/*/ ; do" I would change to: "for SHAREPATH in /mnt/Media/Movies/$(basename "$POOL" .cfg)/*/ ; do" Can someone please advise if I am correct... if not, what do I need to change? Here is the complete mover script from /usr/local/sbin/mover: PIDFILE="/var/run/mover.pid" CFGFILE="/boot/config/share.cfg" LOGLEVEL=0 start() { if [ -f $PIDFILE ]; then if ps h $(cat $PIDFILE) | grep mover ; then echo "mover: already running" exit 1 fi fi if [ -f $CFGFILE ]; then # Only start if shfs includes pools if ! grep -qs 'shareCacheEnabled="yes"' $CFGFILE ; then echo "mover: cache not enabled" exit 2 fi if grep -qs 'shareMoverLogging="yes"' $CFGFILE ; then LOGLEVEL=1 fi fi if ! mountpoint -q /mnt/user0 ; then echo "mover: array devices not mounted" exit 3 fi echo $$ >/var/run/mover.pid [[ $LOGLEVEL -gt 0 ]] && echo "mover: started" shopt -s nullglob # Check for objects to move from pools to array for POOL in /boot/config/pools/*.cfg ; do for SHAREPATH in /mnt/$(basename "$POOL" .cfg)/*/ ; do SHARE=$(basename "$SHAREPATH") if grep -qs 'shareUseCache="yes"' "/boot/config/shares/${SHARE}.cfg" ; then find "${SHAREPATH%/}" -depth | /usr/local/sbin/move -d $LOGLEVEL fi done done # Check for objects to move from array to pools for SHAREPATH in $(ls -dv /mnt/disk[0-9]*/*/) ; do SHARE=$(basename "$SHAREPATH") if grep -qs 'shareUseCache="prefer"' "/boot/config/shares/${SHARE}.cfg" ; then eval "$(grep -s shareCachePool /boot/config/shares/${SHARE}.cfg | tr -d '\r')" if [[ -z "$shareCachePool" ]]; then shareCachePool="cache" fi if [[ -d "/mnt/$shareCachePool" ]]; then find "${SHAREPATH%/}" -depth | /usr/local/sbin/move -d $LOGLEVEL fi fi done rm -f $PIDFILE [[ $LOGLEVEL -gt 0 ]] && echo "mover: finished" } killtree() { local pid=$1 child for child in $(pgrep -P $pid); do killtree $child done [ $pid -ne $$ ] && kill -TERM $pid } # Caution: stopping mover like this can lead to partial files on the destination # and possible incomplete hard link transfer. Not recommended to do this. stop() { if [ ! -f $PIDFILE ]; then echo "mover: not running" exit 0 fi killtree $(cat $PIDFILE) sleep 2 rm -f $PIDFILE echo "mover: stopped" } case $1 in start) start ;; stop) stop ;; status) [ -f $PIDFILE ] ;; *) # Default is "start" # echo "Usage: $0 (start|stop|status)" start ;; esac Any advise is greatly appreciated. Thank you! H.
  2. Are you able to do the phpseclib with the live output in your browser in Swag? I have tried every solution without the output only being displayed at the end. thanks
  3. A big thank you for this! I managed to implement this and it works like a charm…. For me it’s a breakthrough that I have been wishing for a long time! the script above did not work for me… my script contain the install command line from Composer link in your first post. Then I added the command line in you first post. #!/bin/bash echo " " echo "===========================+++++++++++++++======" echo "Installing Hernando Custom Initialization Script" echo "====================+++++++++++++++=============" echo " " echo "-------------------" echo "Installing Composer" echo "-------------------" php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');" echo " " echo "--------------------" echo "Installing PHPSecLib" echo "--------------------" php composer.phar require phpseclib/phpseclib:~2.0 echo " " echo "-------------" echo "Installing MC" echo "-------------" apk add mc echo " " echo "------------------" echo "Installing OpenSSH" echo "------------------" apk add openssh echo " " echo "----------------" echo "Installing Putty" echo "----------------" apk add putty echo " " echo "===========================================" echo "DONE! - Finished Installing Hernando Script" echo "===========================================" echo " I install MC, OpenSSH, and Putty as well. thank you so very much. I really appreciate your help. h.
  4. Years ago I went the used dual Xeon 2670 CPU and ATX SuperMicro motherboard way. From eBay. It was a thread that started here. It’s been and still is awesome. I believe these were pulled from old Facebook servers or something like that. I have a total of 16 cores / 32 threads. It was all very cheap where MB, CPUs and ram totaled like $500 ~ $600. I was curious about AMD and found something that’s potentially similar. There are matched pairs of AMD Opteron 2.6Ghz 12 core CPUs for $17. Then there are motherboards for dual Opteron CPUs that are quite cheap as well. I have not researched enough nor am I an AMD expert to see if CPUs and MBs are compatible. This would be 24 cores. Is this something similar and/or better than the used Xeon adventure? Or are these CPUs way inferior to the old Xeon E5 2670? My Xeon CPUs are probably well over 10 years old. The AMD items: CPUs Motherboard It sounds too good to be true… hoping to get some quick thoughts before I start diving down that rabbit hole. thanks. H.
  5. VI is horrible.... nano is a little better... but maybe try installing Midnight Commander (mc) "apk add mc" and that has a text editor.... Also, from the Swag command line, you can also type "chmod -R 777 /config/" then you can edit the files in Windows using Notepad++... always take note that the line end should be set to UNIX:
  6. Thank you. As a newbie you are doing great. it’s normal if you update a docker to loose anything you install. To overcome this, create a sub folder in /cache/appdata/swag and call it “custom-cont-init.d”. The in that folder, create a script file and call it “install-compose.sh”. Edit that file and enter all the command lines for installation. This way, any time the dockers gets updated, it will run this script, and reinstalls. thanks again. I will try it out in the morning. h.
  7. Wow!! This looks promising. Thank you. Into which directory did you download/install Composer? can’t wait to try it. thank you. H.
  8. You can create a custom scrpt w UserScript plug-in where you can run it hourly or daily…. Or a custom cron setting.
  9. Hi…. Nginx is Swag….. if you have setup Swag, you will have /cache/app data/Swag/www/. Create a webtree sub folder in that and copy the files. Then to see it go to your Swags WebUI, for example 192.168.1.102:84/webtree. You only need proxy-confs when stuff is running on separate dockers. I assume you know how to access the Swag interface outside of you home network…..
  10. How can I execute a UserScript from inside a docker? In Swag, I want to create a php web page that has a link to execute a UserScript. The script tells other dockers to do stuff. I’m thinking that I will need to ssh into the unRAID console. I would love to see a php snippet on how to ssh and run the command. ‘’thank you.
  11. Hi guys, I have an internal local PHP web site (not available from open internet) running on Swag. There should not be any security risk in doing this. I want to be able to execute an unRAID user script from that web site. I cannot figure out how to do it. I read that it can be achieved by using phpseclib. But I don’t know how to install it in Swag. There is very little info on installing it. I’m trying to ssh from php into my unRAID to execute command. But have not been able to. I have created a very nifty script. I use Kodi and Couch….Normally when new movie is added, the Kodi scan lasts a loooooong time. Big library. I also use my TinyMediaManager CLI docker to do a full scrape of /mnt/cache/Media/Movies after downloading. I have a PHP script that parses the subdirectories in folder above. Then I run a php script that instructs Kodi to run a scan of each of the new folders located now in /mnt/user/Media/Movies/“New Movie Folder1”. The scan takes 4 seconds and they are in the llibrary. Couchpotato has stopped being able to update Kodi Leía. I would love to execute this on the fly from my web site. Please help. Thank you, h.
  12. Worked perfect for me using SpaceInvaders settings. Is there a way a legitimate way to enter a Product Key / Activation method? Here is how to enter product key. Takes a while for the script to run.. be patient. https://shaadlife.com/activate-windows-11/ Thank you Ed! H.
  13. Hi Team, it looks like CP has not been updated for a while. I use Kodi Leía. CP no longer sends notifications to Kodi to update its library. It connect properly. But I suspect CP is sending outdated command to Kodi. On the setup page it’s clearly listed as Isengard and Helix compatible. Nothing beyond that. Does anyone experience the same issue? Is there a command in the code where this can be updated? thank you! H.
  14. If you want local access, In MusicBee, you cannot have a library and point it to the unraid music share? And use Plex only when you have to. I use mostly use Kodi on my HTPC. With the Headphones docker, it handles the metadata… and notifies Plex, Kodi and others to update the music library. At work, I use Airsonic/Subsonic plugin in MusicBee… Airsonic can handle the Metadata as well. Airsonic is tricky in setting up so you can access it outside your network. That is where the Swag docker comes in. i don’t really listen to music on my phone… but have you tried Plexamp? I just started trying Plexamp in my car via Bluetooth… “Hey Siri… play XYZ”. I think she asks you what app you want it to play, you pick Plexamp. There is a Windows and Mac version as well. I have not tried those… Also, what happens when you feed Plex properly metadata’ed music files? All my music is mp3. I don’t know how Flac metadata is handled and stored.
  15. Why not do the opposite? Store your music on your unRAID and access it on your Win 10 via Plex. You can install headphones and Airsonic (to access outside your network using Music Bee as your player). You will need a Swag docker and domain name setup. Spaceinvader has a good video on this.
  16. Nexcloud. This is self hosted; the files are stored only in your unRAID and on the client machines.. It will require Swag, and a letsencrypt domain if you want to access from outside your network. It is a bit complicated to setup if you are a noob, but a good way to learn about proxies and domain names. Spaceinvader did a video... Good luck.
  17. Hi Guys, I have configured my media files to be organized like this: /Media/Movies/ /Media/Music/ /Media/TV/ I use both Kodi and Plex. My libraries have gotten pretty huge. Every time I go into those folders (from Windows) it takes a while to load the folders. What is the best practice once you get to this level? Do you just keep adding to the same folders? Or do you create additional folders like this: /Media/Movies2/ /Media/Music2/ /Media/TV2/ I would love to hear what you big collectors are doing. Any advantages or disadvantages? Thanks.
  18. I know this topic is old... but when investigating this, I found the solution for this IF you are using a Linuxserver docker. @Roxedus pointed to the solution above; BUT it was not quite working. In my case, I was trying to run a script to the SWAG docker. In /cache/appdata/swag folder, create a folder called "custom-cont-init.d" in that folder, create a script file, in my case, I called it install.sh. Here are the contents of this file: #!/bin/bash echo "**** Sending Update/Upgrade Commands ****" apk ugrade apk update echo "**** installing OpenSSH and MC ****" apk --update add --no-cache openssh apk --update add --no-cache mc For installing packages to your Docker, the upgrade and update commands are critical. Otherwise you will get a "package not found" error. Re-install the Docker, and the script gets executed. Check out the Dockers log page and you will see the results of the script. Amazing thing about the LSIO guys, they think of EVERYTHING.... Donate!
  19. Hi Terrance, Can you please clarify the above? Does this mean that one has to: Disable Pihole Launch a video and pause it (ads always play at start of video) Enable Pihole, and then you watch ad-free? Can I impose on you to clarify how one would add your Regex into Pi-Hole? It's simple right? Thank you! H.
  20. Nginx has been replaced with SWAG; but it should work with NGINX docker. But it's recommended you upgrade. There are posts about it. You can download the Webtrees package: http://webtrees.net/download Go to /cache/appdata/YourNginxDockerFolderHere/www/ Extract the downloaded files into this folder. Everything should be in a sub-directory called "webtrees". Then in your browser, go to the Nginx WebUI address... and then add "/webtrees/" at the end of the URL. Hit "Enter" and you should see the UI. I tested it and it worked.... You will need to install and properly configure the MariaDB Docker. You may even need to manually create the database for webtrees. I don't know if the wizard will create the table for you. If you don't know how to do that, please Google it. Good luck.
  21. From the description, it reads like it can run inside a SWAG docker and access to a MariaDB Docker....
  22. I know... it's weird.... I am using Stylus.... not the best as I cannot get modifications on my iOS devices. Thanks, H.
  23. Thanks Jonathanm..... unfortunately I am not sure how to code what you suggest... Can you please provide more detail? Thanks.