Add option to remove .log files on WP Engine

Resolved: summary

Local 9.2.9 is out now with a fix for this issue. Local will no longer create new log and SQL files with each push or pull.

https://localwp.com/releases/9.2.9/

  • Stop timestamping log files within the _wpeprivate folder during pushes to/pulls from WP Engine.

More detail: what has changed?

Local 9.2.9+ will now overwrite the same log and SQL dump files, preventing files from building up with custom timestamps during each push and pull but retaining the last file from each push/pull to assist with debugging and restores:

Old file name New file name When is it created?
[sitename]-push-[timestamp].log local-push.log During push
[sitename]-pull-[timestamp].log local-pull.log During pull
push-[timestamp].sql local-backup.sql During push with ‘database’ ticked

Where to find remote logs, plus optional manual cleanup

You can find the above old or new log and SQL dump files in your install at /home/wpe-user/sites/[installname]/_wpeprivate, accessible via SSH.

Local will no longer timestamp new log or dump files from version 9.2.9 onward, but it does not clean up old log or dump files. We found that an extra cleanup step for historic files would slow down every push/pull, and wasn’t needed for new users or those running 9.2.9+.

If you have previously pushed to/pulled from WPE and want to remove “old files” listed above, follow the steps below. It’s important to make sure everyone pushing/pulling to your site is on Local 9.2.9 or higher first.

  1. SSH to your site. https://wpengine.com/support/ssh-gateway/
  2. cd to your site root, substituting [installname] (removing the brackets) with your site name as it appears in your WPE dashboard.
    cd /home/wpe-user/sites/[installname]/_wpeprivate
    
  3. Run this command to remove old log files:
    rm -f -- *-pull-[0-9]*.log *-push-[0-9]*.log push-[0-9]*.sql
    

That’s it. Do not remove anything else in that directory, such as config.json.

If you’re not sure about these steps, have any questions, or want help removing files, please contact WPE support, pointing them to this post.