make-deploy/cron.mk

20 lines
649 B
Makefile
Raw Permalink Normal View History

2023-01-04 14:40:54 +00:00
MANDATORY-cron = true
2022-07-08 17:46:22 +00:00
start-cron:
2023-01-04 14:40:54 +00:00
@- echo "\n### starting..."
@- $(foreach host,$(DEPLOY_HOSTS), \
echo "$(host)"; \
2023-06-05 09:54:30 +00:00
ssh $(SSH_USER)@$(host) "sudo -u $(CRON_USER) sh -c 'crontab -l | sed \"/^#make-deploy-cron:$(DEPLOY_NAME)/,+1 d\" | { cat; echo \"#make-deploy-cron:$(DEPLOY_NAME)\"; cat \"$(DEPLOY_PATH)/$(DEPLOY_NAME)/crontab\"; } | crontab -'"; \
sleep $(DEPLOY_START_DELAY); \
2023-01-04 14:53:58 +00:00
)
2023-01-04 14:28:29 +00:00
2022-07-08 17:46:22 +00:00
stop-cron:
2023-01-04 14:40:54 +00:00
@- echo "\n### stopping ..."
@- $(foreach host,$(DEPLOY_HOSTS), \
echo "$(host)"; \
2023-06-05 09:54:30 +00:00
ssh $(SSH_USER)@$(host) "sudo -u $(CRON_USER) sh -c 'crontab -l | sed \"/^#make-deploy-cron:$(DEPLOY_NAME)/,+1 d\" | crontab -'"; \
2023-01-04 14:53:58 +00:00
)
2022-07-08 17:46:22 +00:00
2023-01-04 14:42:44 +00:00
pull-cron:
#nop