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.

Throttle rsync (flie manager transfers) while copying / transfering files to array

Featured Replies

Put the following script in your /boot/config/go file or add a script to the Users Scripts plugin and set it to "At First Array Start Only":

This script adds a bandwith limit to all rsync processes as long the destination path of rsync is an array disk. For me 60 MB/s works really good. Feel free to adjust 60000 to your needs. Since I use it, my array is much more responsive while rsync is running.

# -------------------------------------------------
# Throttle rsync transfers to array disks v1.0
# -------------------------------------------------

# rename original rsync
[[ ! -f /usr/bin/rsync.orig ]] && mv /usr/bin/rsync /usr/bin/rsync.orig


if [[ -f /usr/bin/rsync.orig ]]; then

  # create wrapper script
  cat <<'##EOF' | sed -E 's/^ {4}//' >/usr/bin/rsync 
    #!/bin/bash
    # rsync wrapper to throttle transfers to /mnt/diskX

    # Check if destination is an Unraid array disk
    add_bwlimit=
    last_arg="${@: -1}"
    if [[ "$last_arg" =~ ^/mnt/disk[0-9]+ ]]; then
      add_bwlimit=1
    fi

    # Check if --bwlimit is already present
    for arg in "$@"; do
      if [[ "$arg" == --bwlimit=* ]] || [[ "$arg" == --bwlimit ]]; then
        add_bwlimit=
        break
      fi
    done

    # execute rsync with bandwidth limit
    if [[ $add_bwlimit ]]; then
      exec -a /usr/bin/rsync /usr/bin/rsync.orig --bwlimit=60000 "$@" # KB/s = 60 MB/s

    # execute original rsync
    else
      exec -a /usr/bin/rsync /usr/bin/rsync.orig "$@"
    fi

##EOF

  # make wrapper executable
  chmod +x /usr/bin/rsync

fi
  • mgutt changed the title to Throttle rsync (flie manager transfers) while copying / transfering files to array

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.

Guest
Reply to this topic...

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.