From d9e0c07eb5aa7c0d35b6f1cc714fa72f413055ab Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Wed, 4 Jan 2023 15:40:54 +0100 Subject: [PATCH] playing with cron --- cron.mk | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cron.mk b/cron.mk index 2b77c88..58b8720 100644 --- a/cron.mk +++ b/cron.mk @@ -1,9 +1,17 @@ -MANDATORY-cron = +MANDATORY-cron = true start-cron: - ssh $(SSH_USER)@$(host) 'crontab -l | sed "/^#make-deploy-cron:$(DEPLOY_NAME)/,+1 d" | { cat; echo "#ck-deploy-cron:$(DEPLOY_NAME)"; cat "$(DEPLOY_NAME)/crontab"; } | crontab -' + @- echo "\n### starting..." + @- $(foreach host,$(DEPLOY_HOSTS), \ + echo "$(host)"; \ + ssh $(SSH_USER)@$(host) 'crontab -l | sed "/^#make-deploy-cron:$(DEPLOY_NAME)/,+1 d" | { cat; echo "#ck-deploy-cron:$(DEPLOY_NAME)"; cat "$(DEPLOY_NAME)/crontab"; } | crontab -'; \ + ) stop-cron: - ssh $(SSH_USER)@$(host) 'crontab -l | sed "/^#make-deploy-cron:$(DEPLOY_NAME)/,+1 d" | crontab -' + @- echo "\n### stopping ..." + @- $(foreach host,$(DEPLOY_HOSTS), \ + echo "$(host)"; \ + ssh $(SSH_USER)@$(host) 'crontab -l | sed "/^#make-deploy-cron:$(DEPLOY_NAME)/,+1 d" | crontab -'; \ + )