Browse Source

Add make/fab setup for hourly cron

master
decentral1se 4 months ago
parent
commit
921aebe73d
Signed by: Luke Murphy <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):
28 28
 
29 29
 @task
30 30
 def dailycron(c):
31
-    """Copy new crontab."""
32
-    print('Copy over new crontab ...')
31
+    """Copy new daily crontab."""
32
+    print('Copy over new daily crontab ...')
33 33
     # See https://github.com/fabric/fabric/issues/1750
34 34
     c.put('./bin/voicegardens-cron-daily', remote='./')
35 35
     c.sudo('mv voicegardens-cron-daily /etc/cron.daily')
36 36
     c.sudo('chown root:root /etc/cron.daily/voicegardens-cron-daily')
37
-    print('New cron in place <3')
37
+    print('New daily cron in place <3')
38
+
39
+@task
40
+def hourlycron(c):
41
+    """Copy new hourly crontab."""
42
+    print('Copy over new hourly crontab ...')
43
+    # See https://github.com/fabric/fabric/issues/1750
44
+    c.put('./bin/voicegardens-cron-hourly', remote='./')
45
+    c.sudo('mv voicegardens-cron-hourly /etc/cron.hourly')
46
+    c.sudo('chown root:root /etc/cron.daily/voicegardens-cron-hourly')
47
+    print('New hourly cron in place <3')
38 48
 
39 49
 @task
40 50
 def cleanarchives(c):

+ 3
- 0
makefile View File

@@ -27,6 +27,9 @@ cleanarchives:
27 27
 dailycron:
28 28
 	@fab -H $(REMOTE_HOST) dailycron
29 29
 
30
+hourlycron:
31
+	@fab -H $(REMOTE_HOST) hourlycron
32
+
30 33
 release: doesitsparkjoy voicegardens
31 34
 
32 35
 .PHONY: dev-serve prod-serve clear-local-archive doesitsparkjoy voicegardens cleanarchives dailycron release

Loading…
Cancel
Save