aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/hourly.py6
-rwxr-xr-xsrc/hourly.sh3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/hourly.py b/src/hourly.py
index 34097a3..5306a85 100755
--- a/src/hourly.py
+++ b/src/hourly.py
@@ -3,6 +3,7 @@
from sys import argv
import subprocess
from os import path
+from time import gmtime, strftime
# our own module used by several scripts in the project
from ztdns_db_connectivity import start_db_connection
@@ -38,7 +39,10 @@ def get_vpn_connections(cursor, hour):
connection = start_db_connection()
cursor = connection.cursor()
-hour = argv[1]
+# round down to an hour - this datetime format is one
+# of the formats accepted by postgres
+hour = strftime('%Y-%m-%d %H:00', gmtime())
+
vpns = get_vpn_connections(cursor, hour)
for vpn_id, config_hash in vpns:
diff --git a/src/hourly.sh b/src/hourly.sh
deleted file mode 100755
index be1c52a..0000000
--- a/src/hourly.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-hourly.py "`date '+%Y-%m-%d %H:00'`"