diff options
| -rwxr-xr-x | install-crontab.sh | 6 | ||||
| -rw-r--r-- | update.exs | 2 | ||||
| -rwxr-xr-x | update.sh | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/install-crontab.sh b/install-crontab.sh new file mode 100755 index 0000000..47c220c --- /dev/null +++ b/install-crontab.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Install crontab to run update script + +SCRIPT_DIR="$(builtin cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" + +(crontab -l 2>/dev/null; echo "*/5 * * * * $SCRIPT_DIR/update.sh") | crontab - @@ -6,7 +6,7 @@ defmodule Instances do def init() do File.rename(@update_file, "#{@update_file}-prev") - update + update() end def request(url) do diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..1ab0d52 --- /dev/null +++ b/update.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +SCRIPT_DIR="$(builtin cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" + +cd "$SCRIPT_DIR" +mix run update.exs |
