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.

Proper rsync command to match unraid default permissions

Featured Replies

Hi, I use rsync via multiple scripts on a daily basis to backup and pull data from a remote server but I alwyas find a little bit annoying setting up the permissions manually to match those in my unraid. 

Default shares permissions is nobody:users 777 (drwxrwxrwx) for directories and 666 for individual files (-rw-rw-rw)

 

My current rsync command is like this:

 

rsync -rltvzh --progress --chown=nobody:users --chmod=775 remote_ip::rsync_module /mnt/user/dir

 

 

but this doesn't not produce the same output permission wise so I wonder if anyone uses rsync in a better way. Thanks

  • Community Expert

?...

rsync -avz --progress --chmod=775 remote_ip::rsync_module /mnt/user/dir
 

Explanation of Options:

-a: Archive mode. Preserves symbolic links, file permissions, modification times, and more.

-v: Verbose. Shows what’s being transferred.

-z: Compress file data during transfer for faster syncing.

--progress: Displays progress of the sync.

--chmod=775: Ensures the files have 775 permissions after the transfer.

 

Key Changes:

Removed -r because -a (archive) already includes recursion.

Removed --chown=nobody:users because it overrides file ownership. If maintaining permissions is crucial, let rsync transfer the original ownership unless there's a specific requirement to change it.

 

 

If the default share permissions on your system are nobody:users with 777 for directories and 666 for files, and you want rsync to maintain the source permissions during the transfer, here’s the corrected command:

 

rsync -avz --progress remote_ip::rsync_module /mnt/user/dir

as Rsync will already do that...

 

Explanation:

-a (archive): Ensures permissions, ownership, timestamps, and symbolic links are preserved.

-v (verbose): Shows detailed output during the transfer.

-z (compression): Compresses file data during the transfer.

--progress: Displays the transfer progress for each file.

 

Important Notes:

Default Behavior:

The -a flag ensures that rsync carries over the original file and directory permissions from the source.

Ownership (nobody:users) and default share permissions (777 for directories, 666 for files) will remain intact as long as they match the source.

No Ownership Changes:

Avoid using --chown unless you specifically need to set ownership differently during transfer.

Preserving Permissions:

If the files and directories on the source have permissions other than 777 or 666, rsync will copy them as-is.

Matching Default Share Permissions:

If you want to enforce 777 for directories and 666 for files explicitly during transfer, add

--chmod=Du=rwx,Dg=rwx,Do=rwx,Fu=rw,Fg=rw,Fo=rw
rsync -avz --progress --chmod=Du=rwx,Dg=rwx,Do=rwx,Fu=rw,Fg=rw,Fo=rw remote_ip::rsync_module /mnt/user/dir


?...

why are you adding a 755 ?

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.