mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
cron
This commit is contained in:
@@ -3,9 +3,8 @@
|
|||||||
import click
|
import click
|
||||||
from fabric import Config, Connection
|
from fabric import Config, Connection
|
||||||
|
|
||||||
from ssh_lib import dotenv_val
|
from ssh_lib import SCRIPTS_DIR, dotenv_val
|
||||||
from ssh_lib.tasks import (
|
from ssh_lib.tasks import (
|
||||||
add_http_host_cron,
|
|
||||||
prepare_http_host,
|
prepare_http_host,
|
||||||
prepare_shared,
|
prepare_shared,
|
||||||
prepare_tile_gen,
|
prepare_tile_gen,
|
||||||
@@ -15,6 +14,7 @@ from ssh_lib.tasks import (
|
|||||||
upload_http_host_files,
|
upload_http_host_files,
|
||||||
)
|
)
|
||||||
from ssh_lib.utils import (
|
from ssh_lib.utils import (
|
||||||
|
put,
|
||||||
sudo_cmd,
|
sudo_cmd,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -67,6 +67,7 @@ def http_host_once(hostname, user, port):
|
|||||||
upload_http_host_config(c)
|
upload_http_host_config(c)
|
||||||
|
|
||||||
prepare_http_host(c)
|
prepare_http_host(c)
|
||||||
|
|
||||||
run_http_host_sync(c)
|
run_http_host_sync(c)
|
||||||
|
|
||||||
|
|
||||||
@@ -82,7 +83,8 @@ def http_host_autoupdate(hostname, user, port):
|
|||||||
upload_http_host_config(c)
|
upload_http_host_config(c)
|
||||||
|
|
||||||
prepare_http_host(c)
|
prepare_http_host(c)
|
||||||
add_http_host_cron(c)
|
|
||||||
|
put(c, SCRIPTS_DIR / 'http_host' / 'cron.d' / 'ofm_http_host', '/etc/cron.d/')
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ def upload_http_host_config(c):
|
|||||||
f'{REMOTE_CONFIG}/rclone.conf',
|
f'{REMOTE_CONFIG}/rclone.conf',
|
||||||
permissions=400,
|
permissions=400,
|
||||||
)
|
)
|
||||||
|
put(c, SCRIPTS_DIR / 'http_host' / 'cron.d' / 'ofm_ledns_reader', '/etc/cron.d/')
|
||||||
|
|
||||||
|
|
||||||
def prepare_http_host(c):
|
def prepare_http_host(c):
|
||||||
@@ -154,10 +155,6 @@ def prepare_http_host(c):
|
|||||||
c.sudo('/data/ofm/venv/bin/pip install -e /data/ofm/http_host/bin')
|
c.sudo('/data/ofm/venv/bin/pip install -e /data/ofm/http_host/bin')
|
||||||
|
|
||||||
|
|
||||||
def add_http_host_cron(c):
|
|
||||||
put(c, SCRIPTS_DIR / 'http_host' / 'cron.d' / 'ofm_http_host', '/etc/cron.d/')
|
|
||||||
|
|
||||||
|
|
||||||
def run_http_host_sync(c):
|
def run_http_host_sync(c):
|
||||||
sudo_cmd(c, '/data/ofm/venv/bin/python -u /data/ofm/http_host/bin/host_manager.py sync')
|
sudo_cmd(c, '/data/ofm/venv/bin/python -u /data/ofm/http_host/bin/host_manager.py sync')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user