Browse Source

Add make/fab setup for hourly cron

master
decentral1se 7 months ago
parent
commit
921aebe73d
Signed by: decentral1se <lukewm@riseup.net> GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 16 additions and 3 deletions
  1. +13
    -3
      fabfile.py
  2. +3
    -0
      makefile

+ 13
- 3
fabfile.py View File

@@ -28,13 +28,23 @@ def voicegardens(c):

@task
def dailycron(c):
"""Copy new crontab."""
print('Copy over new crontab ...')
"""Copy new daily crontab."""
print('Copy over new daily crontab ...')
# See https://github.com/fabric/fabric/issues/1750
c.put('./bin/voicegardens-cron-daily', remote='./')
c.sudo('mv voicegardens-cron-daily /etc/cron.daily')
c.sudo('chown root:root /etc/cron.daily/voicegardens-cron-daily')
print('New cron in place <3')
print('New daily cron in place <3')

@task
def hourlycron(c):
"""Copy new hourly crontab."""
print('Copy over new hourly crontab ...')
# See https://github.com/fabric/fabric/issues/1750
c.put('./bin/voicegardens-cron-hourly', remote='./')
c.sudo('mv voicegardens-cron-hourly /etc/cron.hourly')
c.sudo('chown root:root /etc/cron.daily/voicegardens-cron-hourly')
print('New hourly cron in place <3')

@task
def cleanarchives(c):


+ 3
- 0
makefile View File

@@ -27,6 +27,9 @@ cleanarchives:
dailycron:
@fab -H $(REMOTE_HOST) dailycron

hourlycron:
@fab -H $(REMOTE_HOST) hourlycron

release: doesitsparkjoy voicegardens

.PHONY: dev-serve prod-serve clear-local-archive doesitsparkjoy voicegardens cleanarchives dailycron release

Loading…
Cancel
Save