diff options
Diffstat (limited to 'remote')
| -rw-r--r-- | remote/modules/hardware-stats/data/etc/cron.d/usage_stats | 7 | ||||
| -rwxr-xr-x | remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats | 9 |
2 files changed, 9 insertions, 7 deletions
diff --git a/remote/modules/hardware-stats/data/etc/cron.d/usage_stats b/remote/modules/hardware-stats/data/etc/cron.d/usage_stats deleted file mode 100644 index 282ee63e..00000000 --- a/remote/modules/hardware-stats/data/etc/cron.d/usage_stats +++ /dev/null @@ -1,7 +0,0 @@ -# Update usage statistics on server - -SHELL=/bin/sh -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/openslx/sbin:/opt/openslx/bin - -*/5 * * * * root /opt/openslx/scripts/cron-system_usage_update - diff --git a/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats index 6a3829e5..81db23a4 100755 --- a/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats +++ b/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats @@ -178,6 +178,15 @@ for DELAY in 1 1 0; do --data-urlencode "data@$DATAFILE" "$SLX_REMOTE_LOG" | grep -q "RESULT=0"; then rm -f -- "$DATAFILE" echo "$UUID" > "/run/system-uuid" + START=$(( $RANDOM % 5 )) + cat > "/etc/cron.d/usage_stats" <<-EOF + # Update usage statistics on server + + SHELL=/bin/sh + PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/openslx/sbin:/opt/openslx/bin + + ${START}-59/5 * * * * root /opt/openslx/scripts/cron-system_usage_update + EOF exit 0 fi sleep "$DELAY" |
