Tag Archives: Rsync

[Solved] rsync Error: @ERROR: chdir failed rsync error

Question

The client uses the Rsync command to synchronize the following errors:

@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1649) [sender=3.1.2]

Solution:

After troubleshooting, it is caused by the server directory creation failure

[ew_dbbak]
path = /data/dbbak/ew_dbbak/

Rsync client synchronization error

Rsync client synchronization error

Error reason: the password is entered correctly but cannot be synchronized

Solution: because the permission of the account password file on the server is not 600, you need to set the permission to 600 to synchronize it

Solution to IO error encountered in Rsync: skipping file deletion

Previously it was synchronous:

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

So I add the r and force parameters to the sync script.

# cat mirrors.sh
#!/bin/bash
###End an existing rsync process
killall `ps aux|grep rsync|awk -F" " '{print $11}'`
killall `ps aux|grep rsync|awk -F" " '{print $11}'`
echo Ending time `date +%F_%H%M%S`                                  >> /tmp/rsync_process.log
echo '###################Ending time ######################' >> /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 Completion time `date +%F_%H%M%S`                                  >> /tmp/rsync_process.log
echo '###################Completion time ######################' >> /tmp/rsync_process.log

IO error and blade file deletion appeared synchronously

[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

Meanwhile another error still exists:

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]

Taking a closer look at the parameters of rsync, one of the options is:
Delete even if I/O errors occur
(Delete even if I/O error occurs)

[root@mirrors bin]# cat mirrors.sh
#!/bin/bash
###End an existing rsync process
killall `ps aux|grep rsync|awk -F" " '{print $11}'`
killall `ps aux|grep rsync|awk -F" " '{print $11}'`
echo Ending time `date +%F_%H%M%S`                                  >> /tmp/rsync_process.log
echo '###################Ending time ######################' >> /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 Completion time `date +%F_%H%M%S`                                  >> /tmp/rsync_process.log
echo '###################Completion time ######################' >> /tmp/rsync_process.log

OK, so far there is no error.

Solutions to the problem that Ubuntu is stuck when copying large files and can’t mount mobile hard disk normally

Recently, in the process of copying a large number of files (more than 100g) from the Ubuntu system to the mobile hard disk, there is a situation of stuck. At the beginning, it used the direct folder copy and paste method. When it got stuck, it was replaced by the “SCP – R” method, but it didn’t work.

The main reason for this problem is that the write cache of kernel in Ubuntu system is too large, so that there is a congestion bottleneck when writing from high-speed storage to low-speed devices.

The solution is to avoid using file manager and SCP. When copying large files, the following instructions can be used:

rsync -avP source/ target/

Rsync is a remote data synchronization tool, which can quickly synchronize the files between multiple hosts through LAN/WAN, and view the file transfer process and rate, which is very convenient.

In addition, when the copy to the mobile hard disk is stuck, the file index directory is damaged due to forcibly pulling out the mobile hard disk, which makes the Ubuntu system unable to mount the mobile hard disk, and the following error prompt appears:

Failed to mount '/dev/sdb1': Input/output error 
NTFS is either inconsistent, or there is a hardware fault, or it's a 
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows 
then reboot into Windows twice. The usage of the /f parameter is very 
important! If the device is a SoftRAID/FakeRAID then first activate 
it and mount a different device under the /dev/mapper/ directory, (e.g. 
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation 
for more details.

According to the above tips, it can be solved in Windows system  
1. Enter CMD in “run” under windows to enter DOS command line window  
2. Find the volume name of the mobile hard disk (such as G:)  
3. On the command line, enter:

chkdsk G:/f

CHKDSK command is used to scan disk, automatically check and fix index error. There are three stages after the instruction input in step 3 above. If there are a large number of files, it will take a long time, and you need to wait patiently for the repair to be completed. After that, it can be mounted normally in the Ubuntu system.