配置文件 /data/qshell/test.conf

{
   "src_dir"            :   "/data/www/test",
   "bucket"             :   "空间名称",
   "key_prefix"         :   "test/",
   "skip_path_prefixes" :   "node_modules/",
   "skip_fixed_strings" :   ".svn,.git",
   "rescan_local"       :   true,
   "overwrite"          :   true,
   "check_exists"       :   false,
   "check_hash"         :   false,
   "check_size"         :   false,
   "delete_on_success"  :   false,
   "log_file"           :   "/data/qshell/logs/test.log"
}

 

脚本文件 /data/qshell/qrsync.sh

#!/usr/bin/env bash

qshell qupload -c 4 /data/qshell/test.conf

 

crontab 计划

* * * * * flock -xn /tmp/qrsync.lock -c /data/qshell/qrsync.sh

注意:这里使用 flock 防止任务并发执行

 

参数说明

http://github.com/qiniu/qshell/blob/master/docs/qupload.md

 

posted on 2022-02-18 16:00  lbnnbs  阅读(231)  评论(0编辑  收藏  举报