weirdcrap Posted July 13, 2021 Share Posted July 13, 2021 (edited) So because I'm an idiot I started a run of the unbalance plugin to move files off a drive so i can drop it from the array, then had to stop it because I included a disk I didn't mean to. rsync created empty directories on the destination disks first so I now have a bunch of empty folders on the /mnt/disk* shares that don't correspond to the actual location of the data. I would like to delete the empties but am looking for a sanity check to make sure my methodology is sound and I'm not going to break things. https://www.reddit.com/r/unRAID/comments/9chbca/user_share_splitting_and_clean_up/ FIND: for i in {1..6}; do find /mnt/disk$i/ShareName -type d -empty -print; done FIND & DELETE: for i in {1..6}; do find /mnt/disk$i/ShareName -type d -empty -delete; done This seems promising, works on the share level, and can be scaled across all the disks in the array. Can anyone foresee any problems with running one of the above commands and clearing out the empty folders on a share by share basis? I figure by working at the share level I avoid accidentally deleting a top level share that may be empty for whatever reason. EDIT: Well I gave it 48 hours and I couldn't come up with any negative effects so I went for it. It doesn't seem to have had any ill effects, no missing data, etc. Consider this solved. Edited July 15, 2021 by weirdcrap 5 Quote Link to comment
s449 Posted November 4, 2022 Share Posted November 4, 2022 Hey! I have the same issue. I'm trying to break the habit of using Unbalance, but I've been using it for a while now and accumulated a lot of empty folders. Since running that, any issues? Just always want to be extra cautious about doing any scripted deleted commands. Quote Link to comment
Solution weirdcrap Posted November 4, 2022 Author Solution Share Posted November 4, 2022 (edited) 15 hours ago, s449 said: Hey! I have the same issue. I'm trying to break the habit of using Unbalance, but I've been using it for a while now and accumulated a lot of empty folders. Since running that, any issues? Just always want to be extra cautious about doing any scripted deleted commands. I had no problems with the commands above that I can recollect. Just be sure to run FIND before you run FIND & DELETE to make sure you aren't getting anything included you don't want. Edited November 4, 2022 by weirdcrap 1 Quote Link to comment
Teejoo Posted November 13, 2022 Share Posted November 13, 2022 On 7/13/2021 at 7:41 PM, weirdcrap said: do find /mnt/disk$i/ShareName -type d -empty -print; done Hi, I can't get this command to work. It says syntax error near unexpected token `do' In my case I typed do find /mnt/disk$6/Movies T-NET Server -type d -empty -print; done and then pressed enter. What am I doing wrong? Quote Link to comment
ChatNoir Posted November 14, 2022 Share Posted November 14, 2022 On 11/13/2022 at 9:49 AM, Teejoo said: What am I doing wrong? I would guess that you probably need some kind of quotation marks if your share name has a space in it. Not sure if it's 'quotation mark' or "quotation mark" or something else as I am not very comfortable with linux command line myself. Quote Link to comment
weirdcrap Posted November 14, 2022 Author Share Posted November 14, 2022 11 hours ago, ChatNoir said: I would guess that you probably need some kind of quotation marks if your share name has a space in it. Not sure if it's 'quotation mark' or "quotation mark" or something else as I am not very comfortable with linux command line myself. Yes If you have any spaces in your share name you need to either escape them or wrap the share name in quotes. Quote Link to comment
Teejoo Posted November 15, 2022 Share Posted November 15, 2022 20 hours ago, weirdcrap said: Yes If you have any spaces in your share name you need to either escape them or wrap the share name in quotes. That will be the issue. However, I solved it making the disc a share and deleted them using explorer. 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.