我在 WinXP 上运行 Cygwin。我编写了以下 shell 脚本来将文件从网络驱动器复制到远程服务器...
scp -P 9998 //tdggendska10/vig-preview-dmz-prod/docs/sbo/pdf/*ela*L1*TE* dalvarado@localhost:/var/www/html/sbo/2010/teacher/ela/level1
scp -P 9998 //tdggendska10/vig-preview-dmz-prod/docs/sbo/pdf/*ela*L1*SE* dalvarado@localhost:/var/www/html/sbo/2010/student/ela/level1
scp -P 9998 //tdggendska10/vig-preview-dmz-prod/docs/sbo/pdf/*ela*L2*TE* dalvarado@localhost:/var/www/html/sbo/2010/teacher/ela/level2
scp -P 9998 //tdggendska10/vig-preview-dmz-prod/docs/sbo/pdf/*ela*L2*SE* dalvarado@localhost:/var/www/html/sbo/2010/student/ela/level2
问题是当我运行这个脚本时,偶尔我会得到类似下面的错误(“没有这样的文件或目录”),然后脚本就会停止。
sh copy_files.sh
...
cb_sb_ela_miu_L1_U2_activity2_12_SE.pdf 100% 771KB 51.4KB/s 00:15
cb_sb_ela_miu_L1_U2_activity2_13_SE.pdf 100% 716KB 55.0KB/s 00:13
cb_sb_ela_miu_L1_U2_activity2_14_SE.pdf 100% 966KB 50.8KB/s 00:19
cb_sb_ela_miu_L1_U2_activity2_15_SE.pdf 71% 640KB 36.9KB/s 00:06 ETA
//tdggendska10/vig-preview-dmz-prod/docs/sbo/pdf/cb_sb_ela_miu_L1_U2_activity2_15_SE.pdf: No such file or directory
即使出现此错误消息,有没有办法让脚本继续复制文件?