diff --git a/chunkymap-cronjob b/chunkymap-cronjob index 12d62ec..1be6e4b 100644 --- a/chunkymap-cronjob +++ b/chunkymap-cronjob @@ -1,4 +1,8 @@ #!/bin/sh # NOTE: only works since all scripts in /etc/cron.*/ or crontab run as root #python /home/owner/minetest/util/chunkymap-regen.py -flock -n /var/run/chunkymap-regen.lockfile -c /home/owner/minetest/util/chunkymap-regen.sh \ No newline at end of file +#-1 FOR LESS THAN ONE MINUTE AGO: +MT_PLAYERS_ACTIVE_COUNT=$(find /var/www/html/minetest/chunkymapdata/players -type f -mmin -1 | wc -l) +if[ $MT_PLAYERS_ACTIVE_COUNT -gt 0 ]; then + flock -n /var/run/chunkymap-regen.lockfile -c /home/owner/minetest/util/chunkymap-regen.sh +fi \ No newline at end of file