[root@ecs-ossimport-master01 /data/test]# cat job.sh
#!/bin/bash
dir_pwd=`pwd`
dir_incr=$dir_pwd/incr
dir_check=$dir_pwd/check
[ ! -d $dir_incr ] && mkdir -p $dir_incr
[ ! -d $dir_check ] && mkdir -p $dir_check
read -p "请输入要迁移bucket名称:" bucket_name
read -p "是否增量模式【y/n】:" isIncr
read -p "增量迁移时间间隔【s】:" incremental
read -p "请输入源端bucket名称:" srcB
read -p "请输入目标端bucket名称:" destB
read -p "请输入任务类型【q/j】:" jobType
case $isIncr in
Y | y)
isIncremental=true;;
N | n)
isIncremental=false;;
*)
echo "error"
esac
[ -z $incremental ] && incrementalModeInterval=3600 || incrementalModeInterval=$incrementalModeInterval
[ -z $srcB ] && srcBucket=$bucket_name || srcBucket=$srcBucket
[ -z $destB ] && destBucket=$bucket_name || destBucket=$destBucket
#echo $isIncremental
#echo $incrementalModeInterval
#echo $srcBucket
#echo $destBucket
srcAccessKey=CxxxxxxxxxxxxxxxxxxJ
srcSecretKey=HxxxxxxxxxxxxxxxxxxxxxxxM
srcDomain=http://oss-cn-kunming-fdxxx-d01-a.ops.cloud-test.fudxxxx-xxxx.com
destAccessKey=UxxxxxxxxxxxxxxxW
destSecretKey=pCxxxxxxxxxxxxxxxxxxxxxxxr
destDomain=http://oss-cn-kunming-fdxxxx-d01-a.ops.topclxxxx.fdbxx.dev
case $jobType in
q)
jobType=import
cat > $dir_incr/${bucket_name}.cfg << EOF
jobName=${bucket_name}_incr
isIncremental=$isIncremental
incrementalModeInterval=$incrementalModeInterval
srcType=oss
srcAccessKey=${srcAccessKey}
srcSecretKey=${srcSecretKey}
srcDomain=${srcDomain}
srcBucket=${srcBucket}
srcPrefix=
destAccessKey=${destAccessKey}
destSecretKey=${destSecretKey}
destDomain=${destDomain}
destBucket=${destBucket}
destPrefix=
jobType=${jobType}
importSince=0
lastModify=0
isSkipExistFile=true
taskObjectCountLimit=10000
taskObjectSizeLimit=10000000000
scanThreadCount=1
maxMultiThreadScanDepth=1
multipartUploadThreshold=150m
multipartUploadPartSize=50m
uploadThreadNumPerLargeFile=3
isServerSideEncryption=false
isAllowSymbolicLink=false
getObjectMetaMode=stat
isAuditAfterImport=true
auditMode=general
EOF
;;
j)
jobType=audit
cat > $dir_check/${bucket_name}.cfg << EOF
jobName=${bucket_name}_incr
isIncremental=$isIncremental
incrementalModeInterval=$incrementalModeInterval
srcType=oss
srcAccessKey=${srcAccessKey}
srcSecretKey=${srcSecretKey}
srcDomain=${srcDomain}
srcBucket=${srcBucket}
srcPrefix=
destAccessKey=${destAccessKey}
destSecretKey=${destSecretKey}
destDomain=${destDomain}
destBucket=${destBucket}
destPrefix=
jobType=${jobType}
importSince=0
lastModify=0
isSkipExistFile=true
taskObjectCountLimit=10000
taskObjectSizeLimit=10000000000
scanThreadCount=1
maxMultiThreadScanDepth=1
multipartUploadThreshold=150m
multipartUploadPartSize=50m
uploadThreadNumPerLargeFile=3
isServerSideEncryption=false
isAllowSymbolicLink=false
getObjectMetaMode=stat
isAuditAfterImport=true
auditMode=general
EOF
;;
*)
echo "error"
esac
ossimport自动生成配置文件【迁移/校验】可选
于 2023-07-05 18:13:22 首次发布