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.

One-liner to repair rsync empty directories

Featured Replies

It'd be cool if this was some sort of plugin or something, but I recently had a problem where rsync created ALL the directories before moving any files for an 8TB or so network copy, and proceeded to completely fill a 5TB disk until writes failed. Apparently the reason the high-water-mark setting didn't work was the first disk had enough space for all the directory entries, so the entire folder structure ended up on /mnt/disk3. I had it set to only split on top-level directories since this was for TV shows and I want all seasons to be contained in one drive only for each show. After some reading, I decided I needed to shard (love that word 💩) the folders to other disks, which would maintain the view under /mnt/user but allow rsync to put different shows on different drives. I came up with this, run from disk3's tv root:

 

find . -type d -empty -maxdepth 1 -print0 | \
  while IFS= read -r -d '' file; do
    DISK=$((5 + $RANDOM % 3)); 
    mkdir -p /mnt/disk${DISK}/tv && mv "$file" /mnt/disk${DISK}/tv/; 
  done

This successfully put approximately the same number of subdirectories on each disk. Just thought I'd share and see if anyone else has solved this another way or has any suggestions. I think it'd be good if shfs could split out empty directories smartly, but that might be too much to ask or be technically impossible.

Edited by falcor
fixing code

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.