#! /Bin/shsrc_file = $ 1dst_file = $2 # cur_time = $ (Date "+ % H: % m: % s") # end_time = '09: 00: 00 'cur _ date = $ (Date "+ % Y-% m-% d % H: % m: % s ") end_date = '2017-08-25 14:58:00 '# end_date = '2017-06-01 08:31:00' cur _ datestamp = $ (date-d "$ (Date" + % Y-% m-% d % H: % m: % s ")" + % s); end_datestamp = $ (date-d "$ end_date" + % s ); # echo $ cur_datestamp # echo $ end_datestampdeclare-I countercounter = 0 echo $ cur_datestampecho $ end_datestampwhile [[$ end_dates Tamp-GT "$ (date-d" $ (Date "+ % Y-% m-% d % H: % m: % s") "+ % s) "]; dosrc_crc = $ (md5sum $1) src_val =$ {src_crc: 0: 32} echo" CP $1 $2 "; CP $1 $2; dst_crc = $ (md5sum $2) dst_val =$ {src_crc: 0: 32} if ["$ src_val" = "$ dst_val"]; thenecho "$ counter $ (Date" + % Y-% m-% d % H: % m: % s ") $ (date-d "$ (Date" + % Y-% m-% d % H: % m: % s ")" + % s) Copy result OK! "> Result. file; elseecho "$ counter $ (Date" + % Y-% m-% d % H: % m: % s ") $ (date-d "$ (Date" + % Y-% m-% d % H: % m: % s ")" + % s) Copy result failed! "> Result. file; ficounter = $ counter + 1; done; echo" CP end! "> Result. file; echo" time end "