Skip to content

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.

1 participant