Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve log cleanup script and enhance error handling #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mnott
Copy link

@mnott mnott commented Jan 20, 2025

  • Rewrite log cleanup script for better efficiency and safety
  • Enhance error handling and reporting in cleanup process
  • Implement final cleanup task to ensure script removal

Changes in airflow-log-cleanup-pwdless-ssh.py:

  • Updated log_cleanup script:

    • Use bash heredoc for improved readability
    • Implement more robust file processing with while loop
    • Add error handling for file operations
    • Include removal of empty directories
  • Modified create_log_cleanup_script task:

    • Use heredoc for script creation
    • Improve host detection and script distribution
  • Refactored cleanup tasks:

    • Enhanced error checking for script existence
    • Improved SSH command execution and error handling
    • Added return value checking for cleanup operations
  • Added final_cleanup task:

    • Ensures removal of temporary cleanup script
    • Uses bash -c to avoid template issues
  • Updated task dependencies:

    • All cleanup tasks now feed into final_cleanup task

These changes improve the overall reliability and efficiency of the log cleanup process, while also enhancing error reporting and ensuring proper cleanup of temporary files.

- Rewrite log cleanup script for better efficiency and safety
- Enhance error handling and reporting in cleanup process
- Implement final cleanup task to ensure script removal

Changes in airflow-log-cleanup-pwdless-ssh.py:

- Updated log_cleanup script:
  - Use bash heredoc for improved readability
  - Implement more robust file processing with while loop
  - Add error handling for file operations
  - Include removal of empty directories

- Modified create_log_cleanup_script task:
  - Use heredoc for script creation
  - Improve host detection and script distribution

- Refactored cleanup tasks:
  - Enhanced error checking for script existence
  - Improved SSH command execution and error handling
  - Added return value checking for cleanup operations

- Added final_cleanup task:
  - Ensures removal of temporary cleanup script
  - Uses bash -c to avoid template issues

- Updated task dependencies:
  - All cleanup tasks now feed into final_cleanup task

These changes improve the overall reliability and efficiency of the
log cleanup process, while also enhancing error reporting and
ensuring proper cleanup of temporary files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants