Browse Source

reduce minutely runs by checking for active players first

master
poikilos 9 years ago
committed by Jacob Gustafson
parent
commit
b9da5bc6e5
  1. 6
      chunkymap-cronjob

6
chunkymap-cronjob

@ -1,4 +1,8 @@
#!/bin/sh #!/bin/sh
# NOTE: only works since all scripts in /etc/cron.*/ or crontab run as root # NOTE: only works since all scripts in /etc/cron.*/ or crontab run as root
#python /home/owner/minetest/util/chunkymap-regen.py #python /home/owner/minetest/util/chunkymap-regen.py
flock -n /var/run/chunkymap-regen.lockfile -c /home/owner/minetest/util/chunkymap-regen.sh #-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
Loading…
Cancel
Save