rsync同出出现 IO error encountered — skipping file deletion 解决办法

 之前是同步出现:

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1650) [generator=3.1.2]

于是我给同步脚本 加上r和force参数。

 

# cat mirrors.sh
#!/bin/bash
###结束现有rsync进程
killall `ps aux|grep rsync|awk -F" " '{print $11}'`
killall `ps aux|grep rsync|awk -F" " '{print $11}'`
echo 结束时间 `date +%F_%H%M%S`                                  >> /tmp/rsync_process.log
echo '###################结  束   时  间 ######################' >> /tmp/rsync_process.log
#http://mirrors.ustc.edu.cn/help/rsync-guide.html
URL="rsync://mirrors.tuna.tsinghua.edu.cn"
#URL="rsync://rsync.mirrors.ustc.edu.cn/repo"
rsync -ravzPH --delete  --force                $URL/centos/ /data/centos/ >> /tmp/rsync_centos.log 
rsync -ravzPH --delete  --force                $URL/epel/   /data/epel    >> /tmp/rsync_epel.log   
#rsync -avzPH --delete                  $URL/ceph/ /data/ceph >> /tmp/rsync_ceph.log
echo 完成时间 `date +%F_%H%M%S`                                  >> /tmp/rsync_process.log
echo '###################完  成   时  间 ######################' >> /tmp/rsync_process.log

看到同步出现 IO error encountered — skipping file deletion 

[root@mirrors tmp]# tail -f rsync_centos.log
|   Service Provided by                            |
|      neomirrors                                  |
|                                                  |
+==================================================+

 Note: This service is provided with a modified
 version of rsync. For detailed information, please
 visit: https://github.com/tuna/rsync

receiving incremental file list
IO error encountered -- skipping file deletion

同时另一报错还是存在:

rsync: readlink_stat("7.7.1908/isos/x86_64/.CentOS-7-x86_64-Everything-1908.iso.RjFDl5" (in centos)) failed: Permission denied (13)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1650) [generator=3.1.2]

仔细查看了一下rsync的参数,发现有一个选项是:

--ignore-errors 即使出现 I/O 错误也进行删除

(即使出现 I/O 错误也进行删除)

[root@mirrors bin]# cat mirrors.sh
#!/bin/bash
###结束现有rsync进程
killall `ps aux|grep rsync|awk -F" " '{print $11}'`
killall `ps aux|grep rsync|awk -F" " '{print $11}'`
echo 结束时间 `date +%F_%H%M%S`                                  >> /tmp/rsync_process.log
echo '###################结  束   时  间 ######################' >> /tmp/rsync_process.log
#http://mirrors.ustc.edu.cn/help/rsync-guide.html
URL="rsync://mirrors.tuna.tsinghua.edu.cn"
#URL="rsync://rsync.mirrors.ustc.edu.cn/repo"
rsync -ravzPH --delete  --force   --ignore-errors             $URL/centos/ /data/centos/ >> /tmp/rsync_centos.log 
rsync -ravzPH --delete  --force   --ignore-errors             $URL/epel/   /data/epel    >> /tmp/rsync_epel.log   
#rsync -avzPH --delete                  $URL/ceph/ /data/ceph >> /tmp/rsync_ceph.log
echo 完成时间 `date +%F_%H%M%S`                                  >> /tmp/rsync_process.log
echo '###################完  成   时  间 ######################' >> /tmp/rsync_process.log

OK,目前来看是没有报错了。

你可能感兴趣的:(LINUX)