|
|
@ -204,12 +204,15 @@ public class DemoGlueJobHandler extends IJobHandler { |
|
|
|
echo "xxl-job: hello shell" |
|
|
|
echo "xxl-job: hello shell" |
|
|
|
|
|
|
|
|
|
|
|
echo "脚本位置:$0" |
|
|
|
echo "脚本位置:$0" |
|
|
|
echo "参数数量:$#" |
|
|
|
echo "任务参数:$1" |
|
|
|
|
|
|
|
echo "分片序号 = $2" |
|
|
|
|
|
|
|
echo "分片总数 = $3" |
|
|
|
|
|
|
|
<#--echo "参数数量:$#" |
|
|
|
for param in $* |
|
|
|
for param in $* |
|
|
|
do |
|
|
|
do |
|
|
|
echo "参数 : $param" |
|
|
|
echo "参数 : $param" |
|
|
|
sleep 1s |
|
|
|
sleep 1s |
|
|
|
done |
|
|
|
done--> |
|
|
|
|
|
|
|
|
|
|
|
echo "Good bye!" |
|
|
|
echo "Good bye!" |
|
|
|
exit 0 |
|
|
|
exit 0 |
|
|
@ -221,13 +224,18 @@ import time |
|
|
|
import sys |
|
|
|
import sys |
|
|
|
|
|
|
|
|
|
|
|
print "xxl-job: hello python" |
|
|
|
print "xxl-job: hello python" |
|
|
|
|
|
|
|
|
|
|
|
print "脚本文件:", sys.argv[0] |
|
|
|
print "脚本文件:", sys.argv[0] |
|
|
|
for i in range(1, len(sys.argv)): |
|
|
|
print "任务参数:", sys.argv[1] |
|
|
|
|
|
|
|
print "分片序号:", sys.argv[2] |
|
|
|
|
|
|
|
print "分片总数:", sys.argv[3] |
|
|
|
|
|
|
|
<#--for i in range(1, len(sys.argv)): |
|
|
|
time.sleep(1) |
|
|
|
time.sleep(1) |
|
|
|
print "参数", i, sys.argv[i] |
|
|
|
print "参数", i, sys.argv[i]--> |
|
|
|
|
|
|
|
|
|
|
|
print "Good bye!" |
|
|
|
print "Good bye!" |
|
|
|
exit(0)<#-- |
|
|
|
exit(0) |
|
|
|
|
|
|
|
<#-- |
|
|
|
import logging |
|
|
|
import logging |
|
|
|
logging.basicConfig(level=logging.DEBUG) |
|
|
|
logging.basicConfig(level=logging.DEBUG) |
|
|
|
logging.info("脚本文件:" + sys.argv[0]) |
|
|
|
logging.info("脚本文件:" + sys.argv[0]) |
|
|
@ -240,9 +248,12 @@ console.log("xxl-job: hello nodejs") |
|
|
|
var arguments = process.argv |
|
|
|
var arguments = process.argv |
|
|
|
|
|
|
|
|
|
|
|
console.log("脚本文件: " + arguments[1]) |
|
|
|
console.log("脚本文件: " + arguments[1]) |
|
|
|
for (var i = 2; i < arguments.length; i++){ |
|
|
|
console.log("任务参数: " + arguments[2]) |
|
|
|
|
|
|
|
console.log("分片序号: " + arguments[3]) |
|
|
|
|
|
|
|
console.log("分片总数: " + arguments[4]) |
|
|
|
|
|
|
|
<#--for (var i = 2; i < arguments.length; i++){ |
|
|
|
console.log("参数 %s = %s", (i-1), arguments[i]); |
|
|
|
console.log("参数 %s = %s", (i-1), arguments[i]); |
|
|
|
} |
|
|
|
}--> |
|
|
|
|
|
|
|
|
|
|
|
console.log("Good bye!") |
|
|
|
console.log("Good bye!") |
|
|
|
process.exit(0) |
|
|
|
process.exit(0) |
|
|
|