Add make/fab setup for hourly cron
This commit is contained in:
parent
1016f99ca9
commit
921aebe73d
16
fabfile.py
vendored
16
fabfile.py
vendored
@ -28,13 +28,23 @@ def voicegardens(c):
|
|||||||
|
|
||||||
@task
|
@task
|
||||||
def dailycron(c):
|
def dailycron(c):
|
||||||
"""Copy new crontab."""
|
"""Copy new daily crontab."""
|
||||||
print('Copy over new crontab ...')
|
print('Copy over new daily crontab ...')
|
||||||
# See https://github.com/fabric/fabric/issues/1750
|
# See https://github.com/fabric/fabric/issues/1750
|
||||||
c.put('./bin/voicegardens-cron-daily', remote='./')
|
c.put('./bin/voicegardens-cron-daily', remote='./')
|
||||||
c.sudo('mv voicegardens-cron-daily /etc/cron.daily')
|
c.sudo('mv voicegardens-cron-daily /etc/cron.daily')
|
||||||
c.sudo('chown root:root /etc/cron.daily/voicegardens-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
|
@task
|
||||||
def cleanarchives(c):
|
def cleanarchives(c):
|
||||||
|
3
makefile
3
makefile
@ -27,6 +27,9 @@ cleanarchives:
|
|||||||
dailycron:
|
dailycron:
|
||||||
@fab -H $(REMOTE_HOST) dailycron
|
@fab -H $(REMOTE_HOST) dailycron
|
||||||
|
|
||||||
|
hourlycron:
|
||||||
|
@fab -H $(REMOTE_HOST) hourlycron
|
||||||
|
|
||||||
release: doesitsparkjoy voicegardens
|
release: doesitsparkjoy voicegardens
|
||||||
|
|
||||||
.PHONY: dev-serve prod-serve clear-local-archive doesitsparkjoy voicegardens cleanarchives dailycron release
|
.PHONY: dev-serve prod-serve clear-local-archive doesitsparkjoy voicegardens cleanarchives dailycron release
|
||||||
|
Loading…
Reference in New Issue
Block a user