Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Is this script problematic? remove empty directorys

Featured Replies

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 by nuhll

  • 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 by nuhll

  • Author

Hmm, i "fixxed" it by touching a temp file before running the "delete empty folders script" in the folders i want to keep. 

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.

 

  • Author

As always, thanks! So i know im not doing something stupid, again. :)

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.