rsync错误捕获 shell捕获返回码
通过返回值判断:rsync返回值为$?,0表示成功
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
rsync xxx yyyret=$?if [ $ret -ne 0 ]; then echo "失败, 错误码: $ret"fi rsync常用的错误代码:0 Success1 Syntax or usage error2 Protocol incompatibility3 Errors selecting input/output files, dirs4 Requested action not supported: an attempt was made to manipulate 64-bit files on a platform that cannot support them; or an option was specified that is supported by the client and not by the server.5 Error starting client-server protocol6 Daemon unable to append to log-file10 Error in socket I/O11 Error in file I/O12 Error in rsync protocol data stream13 Errors with program diagnostics14 Error in IPC code20 Received SIGUSR1 or SIGINT21 Some error returned by waitpid()22 Error allocating core memory buffers23 Partial transfer due to error24 Partial transfer due to vanished source files25 The --max-delete limit stopped deletions30 Timeout in data send/receive |
浙公网安备 33010602011771号