ossimport自动生成配置文件【迁移/校验】可选

[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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值