Add option to remove .log files on WP Engine

What issue or error are you experiencing?

Every push and pull creates a .log file (and SQL if pushing/pulling the DB) in the _wpeprivate folder on WP Engine.

These files never delete and count towards our storage usage, nor can we run a cron to delete them via a plugin due to file permissions


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

This is every single push and pull


I have tickets in with WPE for a solution and am also raising it here.

Can we have a setting to disable log files being created server side?

Thank you for sharing this @jon_stormbox! I’ve shared it with the Local Devs. We’ll see if we can figure out a better way for purging old logs.

Any progress on this?

I have attached an example

Work to investigate and fix this is scheduled to start later this month, @jon_stormbox. We’ll update this post when we have more to share about how this will be solved. Thank you again for reporting this.

Thank you, just downloaded and tested the 9.2.9 Beta and can see this fix has been implemented and even the deletion of the sql backup at end of pulling

3 Likes

Nice!

Yeah, we zeroed in on a solution where we don’t timestamp the logs, so there will only ever be a “pull” or a “push” log that’s rewritten for each Connect event.

So far this is only in Beta, but we’ll be rolling it out to Stable soon!

4 Likes

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.

2 Likes

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.