###########
# Webtool #
###########
# MRTG CCU render
2,7,12,17,22,27,32,37,42,47,52,57 * * * *  env LANG=C /usr/bin/mrtg  /var/www/html/webtool/ccu/mrtg.cfg > /tmp/cron_ccu_mrtg.output 2>&1

# Webtool
59 05 * * * /usr/bin/php /var/www/html/webtool/cron/all_statistics_cron.php
#*/5 * * * * /usr/bin/php ~/www/fn_admin/currentuser.php                        > /tmp/cron_currentuser.output 2>&1
59 23 * * *  ~/www/webtool/cron/cron_level_distribution                            > /tmp/cron_level_distribution.output 2>&1
#0 1 * * *    /usr/bin/php ~/www/fn_admin/all_statistics_cron.php               > /tmp/cron_all_statistics.output 2>&1
#0 1 * * *    /usr/bin/php /var/www/html/fn_admin/cron_remain_accounts.php      > /tmp/cron_remain_accounts.output 2>&1

# Webtool log2db
#*/10 * * * * sleep 180;source ~/.gamerc;/usr/bin/time ~/bin/sendscript all nohostname nosave -s /tmp/log2any_tmp -p <<< "webtool_log2db 2> /dev/null" > /tmp/log2db.output 2>&1 ; (echo "select pg_supernice();" ;set client_encoding='big5'; cat /tmp/log2any_tmp/*) | psql -Upostgres -hbgw log_search | time uniq -c >> /tmp/log2db.output 2>&1

# Macroeconomics
0 5 * * * ~/bin/macroeconomics.sh > /tmp/macroeconomics.log 2>&1
* * * * * ~/bin/moneysupply.sh >> ~/.moneysupply.log 2>&1

# Apex KillUser log
*/3 * * * * ~/www/download/reload_apex_killuser.sh > /tmp/reload_apex_killuser.log 2>&1

# Web Service Error
*/2 * * * * ~/www/web_service_error.sh > /tmp/web_service_error.log 2>&1

# Memory Usage
* * * * * source ~/.gamerc ; ~/bin/sendscript allall -s ~/memory_usage/$(/bin/date +"\%Y-\%m-\%dT\%H:\%M:\%S") -p nohostname nosave <<< "free -m | grep Mem" > /tmp/memory_usage.output 2>&1


############
# 188 Club #
############
#*/1 * * * *   /usr/bin/php /var/www/html/fn_admin/188club.php >> /tmp/188club.log 2>&1


###############
# Test Server #
###############
# Monitor(on Test Server)
*/5 * * * * ~/bin/SKServer CheckAlive all > /dev/null 2>&1

# LogRotate(on Test servers)
37 * * * * ~/bin/SKServer LogRotate all   > /dev/null 2>&1

# DBBackup(on Test servers)
20 4 * * * yes|~/bin/TestCtrl dbbackup    > /dev/null 2>&1

# Localization
*/2 * * * * ~/bin/localize                > /dev/null 2>&1


###############
# LIVE Server #
###############
# Monitor(on ALL LIVE servers)
*/5 * * * * ~/bin/sendscript allall nosave <<< "SKServer CheckAlive all"             > /dev/null 2>&1

# LogRotate(on ALL LIVE servers)
37 * * * * ~/bin/sendscript allall nosave nohostname -p <<< "SKServer LogRotate all" > /dev/null 2>&1

# DBbackup(on ALL LIVE servers)
20 4 * * * yes|~/bin/Ctrl DBbackup                                                   > /dev/null 2>&1

# Restart Territory Channel Daily(only works in FN)
0 4 * * * ~/bin/restart_territory_channel                                            > /dev/null 2>&1

# LIVE database backup
0 */3 * * * /usr/bin/time ~/bin/LIVEDBbackup                                         >> ~/.livedbbackup.log 2>&1

# CoreDump Auto Upload(on ALL LIVE servers)
*/1 * * * * ~/bin/put_live_coredump_to_patch_v2        > /dev/null 2>&1 
