diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index f421f52..0465167 100755 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -19,6 +19,8 @@ services: volumes: - ./scanner/.sbws.ini:/root/.sbws.ini - ./data:/root/.sbws + environment: + INTERVAL_MINUTES: 5 networks: local: ipv4_address: 172.18.0.3 diff --git a/docker/scanner/docker-entrypoint.sh b/docker/scanner/docker-entrypoint.sh index be65677..1d2adfb 100755 --- a/docker/scanner/docker-entrypoint.sh +++ b/docker/scanner/docker-entrypoint.sh @@ -1,7 +1,7 @@ mkdir -p /root/.sbws/log -crontab -l | { cat; echo "*/5 * * * * /usr/local/bin/sbws -c /root/.sbws.ini generate >> /root/.sbws/log/generate.log 2>&1"; } | crontab - -crontab -l | { cat; echo "30 0 * * * /usr/local/bin/sbws -c /root/.sbws.ini cleanup >> /root/.sbws/log/cleanup.log 2>&1"; } | crontab - +crontab -l | { cat; echo "*/$INTERVAL_MINUTES * * * * export INTERVAL_MINUTES=$INTERVAL_MINUTES; /usr/local/bin/sbws -c /root/.sbws.ini generate >> /root/.sbws/log/generate.log 2>&1"; } | crontab - +crontab -l | { cat; echo "35 0 * * * /usr/local/bin/sbws -c /root/.sbws.ini cleanup >> /root/.sbws/log/cleanup.log 2>&1"; } | crontab - service cron start diff --git a/operations/deploy-dev.hcl b/operations/deploy-dev.hcl index aaa723b..28d8bf3 100644 --- a/operations/deploy-dev.hcl +++ b/operations/deploy-dev.hcl @@ -103,6 +103,10 @@ LearnCircuitBuildTimeout 0 task "sbws-scanner-dev-task" { driver = "docker" + env { + INTERVAL_MINUTES = "5" + } + volume_mount { volume = "sbws-dev" destination = "/root/.sbws" diff --git a/operations/deploy-live.hcl b/operations/deploy-live.hcl index 5ad55c2..7b0d336 100644 --- a/operations/deploy-live.hcl +++ b/operations/deploy-live.hcl @@ -103,6 +103,10 @@ LearnCircuitBuildTimeout 0 task "sbws-scanner-live-task" { driver = "docker" + env { + INTERVAL_MINUTES = "60" + } + volume_mount { volume = "sbws-live" destination = "/root/.sbws" diff --git a/operations/deploy-stage.hcl b/operations/deploy-stage.hcl index fb79023..e1d5ee7 100644 --- a/operations/deploy-stage.hcl +++ b/operations/deploy-stage.hcl @@ -103,6 +103,10 @@ LearnCircuitBuildTimeout 0 task "sbws-scanner-stage-task" { driver = "docker" + env { + INTERVAL_MINUTES = "60" + } + volume_mount { volume = "sbws-stage" destination = "/root/.sbws"