Overview
The automated process for running the command sudo /engineyard/bin/binary_log_purge on your database instance has stopped, requiring manual execution. This issue arises because the cron job points to a legacy wrapper that fails to launch. The supported tool is /engineyard/bin/binary_log_purge. A temporary fix was applied, but a permanent solution involves updating the cron entry via a custom Chef cookbook or ensuring the legacy path resolves to the supported binary.
Information
Issue: Automated binary log purge command not running
Cause: The cron job points to a legacy wrapper /usr/local/ey_resin/bin/binary_log_purge which fails to launch. The supported tool is /engineyard/bin/binary_log_purge.
Resolution Steps:
-
Option A — Recommended: Update Cron Entry via Chef Cookbook:
- Add the following recipe to your ey-custom cookbook to ensure the job runs every 4 hours using the supported binary:
if node['dna']['instance_role'] =~ /^db/ cron 'binary_log_purge' do minute '0' hour '*/4' command '/engineyard/bin/binary_log_purge -q' end end - Upload and apply the recipe to your environment:
gem install ey-core ey-core recipes upload --environment <your_environment> ey-core recipes apply --environment <your_environment> - Verify:
sudo crontab -l | grep -i binary_log_purge # Expect: # Chef Name: binary_log_purge # 0 */4 * * * /engineyard/bin/binary_log_purge -q sudo /engineyard/bin/binary_log_purge -q; echo $? # Expect exit code 0
- Add the following recipe to your ey-custom cookbook to ensure the job runs every 4 hours using the supported binary:
-
Option B — Alternative: Ensure Legacy Path Resolves:
- Add the following to your ey-custom cookbook:
directory '/usr/local/ey_resin/bin' do owner 'root' group 'root' mode '0755' recursive true end link '/usr/local/ey_resin/bin/binary_log_purge' do to '/engineyard/bin/binary_log_purge' owner 'root' group 'root' end - Upload/apply as above, then verify:
sudo /usr/local/ey_resin/bin/binary_log_purge -q; echo $? # Expect exit code 0
- Add the following to your ey-custom cookbook:
Important: Ensure cron calls the supported binary. Manage /etc/engineyard/binlogpurge.yml for tuning behavior such as log retention.
Frequently Asked Questions
- How do I know if this issue applies to my situation?
- If your automated binary log purge command has stopped running and you are manually executing it, this issue likely applies to you.
- What if I prefer not to change the cron line?
- You can make the legacy path point to the supported binary by creating a symlink, ensuring the cron job uses the correct executable.
- How can I verify the solution is working?
- After applying the solution, check the cron job with
sudo crontab -l | grep -i binary_log_purgeand run the command manually withsudo /engineyard/bin/binary_log_purge -q; echo $?to ensure it exits with code 0.
Priyanka Bhotika
Comments