From f732df966072ab622f4f92942ff7552953545b7b Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 27 Oct 2020 16:39:00 +0100 Subject: [PATCH] fix crontab setup script --- setup-scripts/setup-health-check-scripts.sh | 9 ++------- setup-scripts/support/crontab | 3 +++ 2 files changed, 5 insertions(+), 7 deletions(-) create mode 100644 setup-scripts/support/crontab diff --git a/setup-scripts/setup-health-check-scripts.sh b/setup-scripts/setup-health-check-scripts.sh index 7d17b85b..c9af726e 100755 --- a/setup-scripts/setup-health-check-scripts.sh +++ b/setup-scripts/setup-health-check-scripts.sh @@ -7,10 +7,5 @@ sudo apt-get -y install python3-pip pip3 install discord.py python-dotenv requests -fundsCheck="0 0,8,16 * * * /home/user/skynet-webportal/setup-scripts/funds-checker.py /home/user/skynet-webportal/.env" -logsCheck="0 0,8,16 * * * /home/user/skynet-webportal/setup-scripts/log-checker.py /home/user/skynet-webportal/.env sia 8" -healthCheck="0 * * * * /home/user/skynet-webportal/setup-scripts/health-checker.py /home/user/skynet-webportal/.env sia 1" - -(crontab -u user -l; echo "$fundsCheck" ) | crontab -u user - -(crontab -u user -l; echo "$logsCheck" ) | crontab -u user - -(crontab -u user -l; echo "$healthCheck" ) | crontab -u user - +# add cron entries to user crontab +crontab -u user /home/user/skynet-webportal/setup-scripts/support/crontab diff --git a/setup-scripts/support/crontab b/setup-scripts/support/crontab new file mode 100644 index 00000000..30b947a8 --- /dev/null +++ b/setup-scripts/support/crontab @@ -0,0 +1,3 @@ +0 0,8,16 * * * /home/user/skynet-webportal/setup-scripts/funds-checker.py /home/user/skynet-webportal/.env +0 0,8,16 * * * /home/user/skynet-webportal/setup-scripts/log-checker.py /home/user/skynet-webportal/.env sia 8 +0 * * * * /home/user/skynet-webportal/setup-scripts/health-checker.py /home/user/skynet-webportal/.env sia 1