shell 脚本里启动多进程执行
下面是shell脚本的部分代码,改代码段是并发 gpg 加密
echo "gpg start...`date` "
#并发加密文件,缩短执行时间
for FILE in `ls -1 /backup/base*.tgz`
do
( gpg -er postgres -o ${FILE}.gpg ${FILE}
)&
done
wait
echo "gpg end...`date` "
下面是shell脚本的部分代码,改代码段是并发 gpg 加密
echo "gpg start...`date` "
#并发加密文件,缩短执行时间
for FILE in `ls -1 /backup/base*.tgz`
do
( gpg -er postgres -o ${FILE}.gpg ${FILE}
)&
done
wait
echo "gpg end...`date` "