Skip to content

Instantly share code, notes, and snippets.

@db-pj
Last active January 8, 2019 11:41
Show Gist options
  • Save db-pj/55b4d0afe6c611dcac8d6100fbf0c944 to your computer and use it in GitHub Desktop.
Save db-pj/55b4d0afe6c611dcac8d6100fbf0c944 to your computer and use it in GitHub Desktop.

http://db-docs.com/00000_Development/00400_Tools/00100_Internal_Tools/900300_Warmer

##Prod Server

  • Create db-admin user on server
    sudo useradd -G www-data db-admin && sudo usermod -a -G db-admin pj && sudo usermod -a -G db-admin rfrankel && sudo usermod -a -G db-admin roberto

##Dev Server ###Cron https://github.com/digital-brands/badcredit.org/tree/master/themes/tdr-framework-child/functions/cron

  • Create cron dir and needed cron files: cron-aliases.sh
  • Create cron logs dir
  • Add all crontab functions to cron.php
  • Encapsulate functions (SE Sitemaps, Warmer, DB Backup, etc)
  • Add good ouput headers
  • Update cron code

###Warmer https://github.com/digital-brands/badcredit.org/tree/master/themes/tdr-framework-child/functions/warmer

  • Add warmer files: warmer-config.php, warmer-aliases.sh
  • Update warmer code

##Follow up

  • Create cron logs dir
  • Confirm .lock files and give ownership to db-admin
  • symlink warm-aliases.sh, cron-aliases.sh to /etc/profile.d/
  • Update www-data permissions
  • Update db-data crontab to cron.php
  • Remove tasks from rfrankel crontab
  • crontab - rotate logs
  • Test cron

cd /home/digitalbrands.com/public_html/wp-content/themes/digitalbrands/functions/cron/ && php cron.php > logs/cron-`date +\%FT\%T\%Z`.log && cd -

0 0 * * * find /home/digitalbrands.com/public_html/wp-content/themes/digitalbrands/functions/cron/logs/cron*.log -ctime +30 -exec rm {} \;

#Sites Finished

  • DigitalBrands.com
  • DealCrunch.com
  • BadCredit.org
  • HostingAdvice.com
  • CardRates.com
  • DatingAdvice.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment