Inotify + Rsync real-time synchronization error reporting
1. Error message
It can be synchronized normally, but the following error message will appear:
[root@192 opt]# ./inotify.sh rsync: failed to set times on "/." (in wwwroot): Operation not permitted (1) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1052) [sender=3.0.9]
The script file is as follows:
[root@192 opt]# vim /opt/inotify.sh #!/bin/bash INOTIFY_CMD="inotifywait -mrq -e modify,create,attrib,move,delete /var/www/html/" RSYNC_CMD="rsync -azH --delete --password-file=/etc/server.pass /var/www/html/ [email protected]::wwwroot/" $INOTIFY_CMD | while read DIRECTORY EVENT FILE ##while Determine if monitoring records are received do if [ $(pgrep rsync | wc -l) -le 0 ] ; then $RSYNC_CMD fi done
2. Solution
Enter the configuration file of Rsync server and change uid and GID to root;
vi /etc/rsyncd.conf uid = root gid = root
Restart Rsync service
kill $(cat /var/run/rsyncd.pid) rsync --daemon
Perform real-time synchronization again and run the script
Similar Posts:
- Rsync Error: failed to set times on “xxxx”: Operation not permitted
- rsync error: some files/attrs were not transferred (see previous errors) (code 23)
- Error 500 when opening the site configured by nginx
- Ubuntu System Goland Error: External file changes sync may be slow: The current inotify(7) watch limit is too low
- [linux] mv: cannot move $ to $: Directory not empty
- PHP nginx 504 gateway timeout gateway timeout error
- 421 Home directory not available – aborting [How to Solve]
- Hadoop Error: rsync error: remote command not found (code 127) at io.c(226) [sender=3.1.2]
- THE DISCUZQ VIRTUALBOX VIRTUAL MACHINE SETS A SOFT LINK IN THE SHARED FOLDER. PROTOCOL ERROR IS REPORTED.
- [Solved] Nginx-FastCGI-“Primary script unknown” while reading response header from upstream,