poikilos
9 years ago
committed by
Jacob Gustafson
4 changed files with 29 additions and 3 deletions
@ -0,0 +1,9 @@ |
|||||
|
#!/bin/sh |
||||
|
# NOTE: only works since all scripts in /etc/cron.*/ or crontab run as root |
||||
|
#python /home/owner/minetest/util/chunkymap-regen.py |
||||
|
#-1 FOR LESS THAN ONE MINUTE AGO: |
||||
|
#lol won't work because if the py doesn't run the players won't be updated |
||||
|
#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-players.sh |
||||
|
#fi |
@ -0,0 +1,16 @@ |
|||||
|
#!/bin/sh |
||||
|
#sudo su - |
||||
|
# NOTE: this works only since user is a field on Ubuntu (on some GNU/Linux systems it is not, which is implied by omission at http://www.adminschoice.com/crontab-quick-reference) |
||||
|
# Minute, Hour, Day of Month, Month (1 to 12), Day of Week |
||||
|
# m h dom mon dow user command |
||||
|
|
||||
|
cd ~ |
||||
|
MT_CHUNKYMAP_CRON_TMP=mts_cron.tmp |
||||
|
if [ ! -f "crontab.1st" ]; |
||||
|
then |
||||
|
cp /etc/crontab "crontab.1st" |
||||
|
fi |
||||
|
crontab -l > "$MT_CHUNKYMAP_CRON_TMP" |
||||
|
echo "* * * * * root /home/owner/minetest/util/chunkymap-players-cronjob" >> "$MT_CHUNKYMAP_CRON_TMP" |
||||
|
crontab "$MT_CHUNKYMAP_CRON_TMP" |
||||
|
rm "$MT_CHUNKYMAP_CRON_TMP" |
Loading…
Reference in new issue