LinuxボックスとNAS間のrsyncd権限の問題

LinuxボックスとNAS間のrsyncd権限の問題

Timeshiftすべてのスナップショットを含むDevuan Linuxボックス内の小さな500 Gbドライブにファイルをバックアップするために、現在OpenWRTで実行されている小さな1TB NASデバイスを設定しましたBackInTime

NASの仕様(800MHz APM82181 / 256MB RAM)は、ssh両端に1000MでネゴシエートするGbEポートを持っていますが、最大7.50MiB / sで作業が完了するのを待つか使用しないでください。

主に暗号化のため、ほぼ一定の100%CPU負荷でこのハードウェアを上回る場合があるため、ssh実行可能なオプションではありません。

すべての作業は外部からアクセスできないローカルネットワーク内で行われ、ユーザーは私だけなので、暗号化の欠如は問題になりません。

これを念頭に置いて、NAS側でデーモンとして使用する以外は選択の余地はありませんrsync。これにより、スループットが少なくとも3.5 / 4.0倍増加しますssh

問題は、解決策が見つからないというエラーが発生することです。

:~$ rsync -av --progress /media/stuff/firefox.oldfile  rsync://[email protected]:/stuff
sending incremental file list
firefox.oldfile
     85,812,416 100%   28.23MB/s    0:00:02 (xfr#1, to-chk=0/1)
rsync: [receiver] mkstemp "/.firefox.oldfile.hiOlHH" (in stuff) failed: Permission denied (13)

sent 85,833,480 bytes  received 142 bytes  24,523,892.00 bytes/sec
total size is 85,812,416  speedup is 1.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]
:~$ 

良いニュースは、(明らかに)28.23MB / sを得ることができるということです。 =^)

私はこれがターゲットフォルダ rsyncに一時ファイルを書き込めないために発生する権限の問題だと読んでいます。/.firefox.oldfile.dMAADG/mnt/sda3/stuff

ログファイルは端末出力に何も追加しません。

root@OpenWrt:~# cat /var/log/rsyncd.log
[2726] connect from UNDETERMINED (192.168.1.2)
[2726] rsync allowed access on module stuff from UNDETERMINED (192.168.1.2)
[2726] rsync to stuff/ from UNDETERMINED (192.168.1.2)
[2726] receiving file list
[2726] rsync: [receiver] mkstemp "/.firefox.oldfile.dMAADG" (in stuff) failed: Permission denied (13)
root@OpenWrt:~#

rsyncd.conf私のファイルが正しいようです。

:/etc$ cat /etc/rsyncd.conf
# /etc/rsyncd.conf
# minimal configuration for rsync daemon
# -----------------------
# begin global parameters 

uid = %RSYNC_USER_NAME%
gid = *
use chroot = true
max connections = 1
pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
read only = false
reverse lookup = no
exclude = lost+found
timeout = 180

hosts allow = 192.168.1.2  # use after everything is working properly
# port =                   # set other than default 873
# socket options =
# ignore nonreadable = 
# dont compress   = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2 

# end global parameters 
# ---------------------------
# begin module parameters

# shared folder for testing
[testdir]
path = /mnt/sda3
read only = false
# comment =

# shared folder for stuff
[stuff]
path = /mnt/sda3
read only = false
# comment =

# shared folder for bkups
[bkups]
path = /mnt/sda3
read only = false
# comment =

私が知る限り、ターゲットディレクトリの所有権は正しいです。

:~$ ls -l /mnt/sda3
drwxrwxrwx    4 groucho  groucho       4096 Apr 25 19:03 bkups
drwxrwxrwx    2 groucho  groucho       4096 Apr 29 18:47 stuff
drwxrwxrwx    2 groucho  groucho       4096 Apr 28 17:53 testdir
:~$ ls -l /mnt

私は数日間この問題のために役に立ちませんでした。

誰もが私のためにこれについて明らかにすることができれば非常に感謝します。

よろしくお願いします。

G.

ベストアンサー1

パスに最低レベルがありません。たとえば、

[stuff]
path = /mnt/sda3
read only = false

これはstuff、rootという名前の共有を定義します/mnt/sda3/mnt/sda3あなたのユーザーはそれ自体に書き込むことはできませんrsyncd

代わりに、実際にフルパスを指定する必要があります。

[stuff]
    path = /mnt/sda3/stuff
    read only = false
    fake user = yes

デーモンユーザーが(おそらく)rootではない場合でも、ユーザー、グループ、および権限の詳細をキャプチャできるfake userように、ここに設定を含めました。rsyncd

通常、次のオプションがあり、そのほとんどはグローバルセクションに配置できます。

[stuff]
    comment = Backup space for stuff
    path = /mnt/sda3/stuff
    hosts allow = ...
    auth users = *
    secrets file = /etc/rsyncd.secrets

    use chroot = yes
    read only = no
    list = yes
    strict modes = yes
    ignore errors = no
    ignore nonreadable = no
    fake super = yes
    transfer logging = no
    timeout = 600
    refuse options = delete
    dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz *.vib *.vbk

おすすめ記事