July 12, 20187 yr I want to remove all directorys after /mnt/user/1/this if its empty so i use find /mnt/user/downloads/completed/this/ -type d -empty -exec rmdir {} \; mkdir /mnt/user/downloads/completed/this in user scripts, i mkdir, bc it deletes "this" also, but should only remove the dirs AFTER "this". It works, but it is problematic for unraid in someway? (i dont think so) Or is there a way to first only delete any folders AFTER "this" and keep "this", even if its empty? BTW. "this" is a user share Edited July 12, 20187 yr by nuhll
July 13, 20187 yr Author Anyone know if its problematic that i remove a user share directory and recreate it every hour? (or know a way i can edit this script so it doesnt delete this Edited July 13, 20187 yr by nuhll
July 13, 20187 yr Author Hmm, i "fixxed" it by touching a temp file before running the "delete empty folders script" in the folders i want to keep.
July 13, 20187 yr 2 hours ago, nuhll said: Hmm, i "fixxed" it by touching a temp file before running the "delete empty folders script" in the folders i want to keep. This is a quite common trick in use. Same as checkout of source code from repositories often may check out place-holder files just to auto-create required directories. You can also consider doing find /mnt/user/downloads/completed/this/* to make find run on the entries in the this/ directory instead of running on this/ itself.
Archived
This topic is now archived and is closed to further replies.