JorgeB Posted April 20, 2018 Share Posted April 20, 2018 8 minutes ago, deagle said: rsync sprayed folders all over the array Yep, that's a problem with rsync, especially on initial sync as it creates immediately all folders on the first available disk. Quote Link to comment
vw-kombi Posted September 18, 2018 Share Posted September 18, 2018 I was pointed to these posts as a way to re-group my TV Shows so they are not spread across two disks. I however do not wish to pass in a target disk but re-group to the same disks they are currently on. Im not sure if this will work ? My issue : After creating my TVSwhows share - MediaTVShows over two disks, and having the default automatic split, I now have stuff spread over the two disks. These two 4TB disks have about 600Meg free on each. I dont have another disk to 'move/consolidate' too - so I wish to do this to the same disks. My structure : Top Dir - media-tvshows Second Dir - TVShow Name Third Dir - Season XX Fourth Dir - Episodes so, after reading this thread, the colsolidate command seems like it can do this - but I want the target disks to be the same disks the stuff is already on. Can a script do this ? Thanks. Quote Link to comment
vw-kombi Posted September 18, 2018 Share Posted September 18, 2018 Never mind - I manually sorted it. (drives are disk2 and disk3) I used krusader to compare the tv shows between the two disks, then used unbalance to select the TV shows that existed on both drives, then it said I would only need 150GB of transfers to move the scattered stuff it back to disk2. That is running now. Going forward, I have changed the share to NOT automatically split so hopefully the issue will not happen again. Quote Link to comment
Shaboobala Posted January 10, 2022 Share Posted January 10, 2022 On 8/3/2016 at 10:03 PM, korpo53 said: Use Putty to remote into your server mkdir /boot/scripts wget https://raw.githubusercontent.com/trinapicot/unraid-diskmv/master/diskmv -O /boot/scripts/diskmv wget https://raw.githubusercontent.com/trinapicot/unraid-diskmv/master/consld8 -O /boot/scripts/consld8 echo "ln -s /boot/scripts/diskmv /usr/sbin" >> /boot/config/go echo "ln -s /boot/scripts/consld8 /usr/sbin" >> /boot/config/go That'll: Create a directory to hold the scripts that survives reboots. Download the scripts to that directory. Add lines to your startup script to create symlinks (shortcuts, sort of) to those permanent files in a non-permanent space that makes them more usable. After doing that, if you don't want to reboot, you can just run the below to create the symlinks right now. They'll get recreated every boot by the go script, so you only have to do this part the first time. ln -s /boot/scripts/diskmv /usr/sbin ln -s /boot/scripts/consld8 /usr/sbin I am hoping for a little help I tried installing using the method described but I am getting permission denied errors. I was hoping someone could help me figure out what is wrong. Thanks Quote Link to comment
itimpi Posted January 12, 2022 Share Posted January 12, 2022 I suspect the instructions are no longer accurate as in the last few Unraid releases security has been tightened so that files on the flash drive are not allowed to have execute permission. instead of using a link as suggested you need to copy the files elsewhere (such as /user/local/bin) and give them execute permission. Quote Link to comment
Shaboobala Posted January 14, 2022 Share Posted January 14, 2022 Thank you @itimpi for responding. I am pretty new to this. Do you know if there is a tutorial that I can read to learn how to do that. Or do you have time to help guide me through the process? Quote Link to comment
Meles Meles Posted January 20, 2022 Share Posted January 20, 2022 On 1/12/2022 at 4:18 PM, itimpi said: I suspect the instructions are no longer accurate as in the last few Unraid releases security has been tightened so that files on the flash drive are not allowed to have execute permission. instead of using a link as suggested you need to copy the files elsewhere (such as /user/local/bin) and give them execute permission. Or you can just "bash" them into submission..... so instead of just doing diskmv blah blah2 (which will fail as no execute permission on diskmv) do bash diskmv blah blah2 Quote Link to comment
Shaboobala Posted January 21, 2022 Share Posted January 21, 2022 Thanks @Meles Meles I am trying to use the consld8 script and earlier in the thread it says to execute it by using this comand Quote find "/mnt/user/Media/Movies" -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0 -n 1 consld8 -f if i were to bash would I put it before find? Sprry for my ignorance is its and obvious answer just trying to learn. Quote Link to comment
Meles Meles Posted January 24, 2022 Share Posted January 24, 2022 On 1/22/2022 at 6:08 AM, Shaboobala said: Thanks @Meles Meles I am trying to use the consld8 script and earlier in the thread it says to execute it by using this comand if i were to bash would I put it before find? Sprry for my ignorance is its and obvious answer just trying to learn. you'd put it just before consold8 find "/mnt/user/Media/Movies" -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0 -n 1 bash consld8 -f Quote Link to comment
Shaboobala Posted January 26, 2022 Share Posted January 26, 2022 The bash runs the script but it appears I am having permission issues when it tries to move the file. It shows where the files are located and where it wants to move them but then I get this error. Any ideas @Meles Meles Quote /usr/sbin/consld8: line 152: /usr/sbin/diskmv: Permission denied Quote Link to comment
WingmanNZ Posted April 5, 2022 Share Posted April 5, 2022 I just discovered these awesome tools and wondered if they respect hardlinks? Quote Link to comment
Guillaurent Posted July 27, 2022 Share Posted July 27, 2022 diskmv is such a lifesaver! I was going to make the exact same script myself and you saved me the trouble Since I coded it, I'm offering my contribution with the diskdu script. It checks the size of /mnt/user/ files or directories in each /mnt/disk*/ and /mnt/cache*/ where it is present. Do what you will with this. It comes with no waranty. #!/bin/bash # diskdu - Summarize disk usage of the set of unRAID user share directories # and/or files # # usage: diskdu [options] file... # # A du operation is made for every disk and every file given as parameters. usage(){ cat << EOF usage: diskdu [options] file... file... The set of files or directories. They can be specified as an absolute or relative path and can be relative to the current directory or the /mnt/user/ directory. Options: --help help, print this help message All other options from the du command can be used. See du --help EOF } [ ${DEBUG:=0} -gt 0 ] && set -x -v shopt -s extglob # Basically the only option understood by this script is --help. The rest is # passed down to du. ARGS=() while [[ $# -gt 0 ]]; do case "$1" in --help) usage exit 0 ;; *) # Default case: add to array of arguments to pass down to du. if [ -e "$1" ] then # File or directory, replace /mnt/user/... with /mnt/disk*/... FULLNAME=$(readlink -e "$1") # Handle relative path MERGEDIR="${FULLNAME#/mnt/*/}" # Remove any /mnt/*/ prefix if [ ! -e "/mnt/user/$MERGEDIR" ] then echo "'$1' is not a valid user share file or directory." >&2 usage >&2 exit 1 fi ARGS+=(/mnt/@(disk*|cache*)/"$MERGEDIR") else # Something for du to figure out ARGS+=("$1") fi ;; esac shift done du "${ARGS[@]}" Quote Link to comment
JonathanM Posted July 27, 2022 Share Posted July 27, 2022 12 minutes ago, Guillaurent said: I'm offering my contribution with the diskdu script Looks like this (and the source script) only work properly if there are no pools with names other than cache. That USED to be the case, but with the advent of multiple cache pools, there is no guarantee that the cache pool will even be named cache, it can be user defined, and there can be more than one. So, if you have a single cache pool named cache, it should work as planned. Otherwise, it looks like it will ignore any other cache pools. I could be reading this wrong though. Quote Link to comment
Guillaurent Posted July 28, 2022 Share Posted July 28, 2022 1 hour ago, JonathanM said: Looks like this (and the source script) only work properly if there are no pools with names other than cache. That USED to be the case, but with the advent of multiple cache pools, there is no guarantee that the cache pool will even be named cache, it can be user defined, and there can be more than one. So, if you have a single cache pool named cache, it should work as planned. Otherwise, it looks like it will ignore any other cache pools. I could be reading this wrong though. I haven't used anything else than 1 cache pool named cache so far. I though it would be named cache cache1 like disks are... If anyone knows how to identify cache mounting points, I (or someone else) could modify the script. Quote Link to comment
Oamster Posted June 13, 2023 Share Posted June 13, 2023 (edited) On 7/22/2015 at 2:05 AM, Benni-chan said: @markswift: i've used consld8 recently for my Movies Collection for the same reason you wish. Since I have a few thousand movie folders, i used following command: (USE AT OWN RISK) find "/mnt/user/Media/Movies" -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0 -n 1 consld8 -f Is there a way I can easily run this as a cron job in userscripts? Tried doing it with just the command but it errors. EDIT Or how would you put this in the mover tuning plugin to run this after each time the mover runs? EDIT2 Disregard! Figured it out, added it to user scripts and pointed mover tuning to: /tmp/user.scripts/tmpScripts/script_name/script Now it will run the consld8 script after every time the mover runs. Edited June 15, 2023 by Oamster Quote Link to comment
Recommended Posts
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.