Last active
April 4, 2021 06:39
-
-
Save naoaki011/4fbcca51372e869716def303c5d98ff6 to your computer and use it in GitHub Desktop.
lsyncd rsync (rsyncssh ではファイルのmvが反映されない模様)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
settings { | |
logfile = "/var/log/lsyncd.log", | |
statusFile = "/var/log/lsyncd.status", | |
statusInterval = 1 | |
} | |
-- /var/www/html | |
sync { | |
default.rsync, | |
source = "/var/www/html/", | |
target = "syncuser@10.0.0.4:/var/www/html/", | |
exclude = "/log", | |
delay = 0, | |
delete = "running", | |
init = false, | |
rsync = { | |
rsync_path = "sudo /usr/bin/rsync", | |
rsh = "/usr/bin/ssh -l syncuser -i /home/syncuser/.ssh/syncuser.pem -p 22 -o StrictHostKeyChecking=no", | |
owner = true, | |
group = true, | |
perms = true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
よりセキュリティを高めるには、/etc/ssh/sshd_config に AllowUsers で syncuser@10.0.0.4 のみに制限するなど。
その場合、全ユーザに対して制限がかかるので、以下のようにログインする必要があるユーザ名を羅列する。