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

Implement 24-hour check for apt cache updates to reduce network-load … #746

Closed
wants to merge 2 commits into from

Commits on Aug 10, 2024

  1. Implement 24-hour check for apt cache updates to reduce network-load …

    …and improve running times
    
    This commit introduces a time-based check to ensure the apt-get cache is updated only once every 24 hours, optimizing resource usage and reducing network load.
    
    Why:
    Many Linux servers, including those within our company, utilize unattended upgrades that automatically update the package database. Limiting cache updates to once every 24 hours helps to minimize unnecessary load on our custom repo mirror/apt-cacher, especially when other services may have already performed an update.
    
    Technical Details:
    Modification Time Check: The script checks the modification timestamp of /var/cache/apt/pkgcache.bin to determine when the last update occurred. It calculates the time elapsed since that update using the timestamp.
    
    Time Difference Calculation: If more than 24 hours (86400 seconds) have passed since the last update, the script triggers an apt-get update, ensuring updates are performed only when necessary.
    
    Benefits:
    Server Load Reduction: By throttling updates, we reduce the load on package servers, apt-cacher proxies, or custom mirrors, preventing server strain and ensuring better availability of resources.
    
    Resource Efficiency: This approach conserves bandwidth and processing power by avoiding unnecessary updates, particularly in stable environments where frequent updates provide minimal benefit.
    
    Reduced Script Run Time: By skipping unnecessary updates, the script executes more quickly.
    FelmeAn authored Aug 10, 2024
    Configuration menu
    Copy the full SHA
    501c23c View commit details
    Browse the repository at this point in the history
  2. fix missing variable FILE

    FelmeAn authored Aug 10, 2024
    Configuration menu
    Copy the full SHA
    1805978 View commit details
    Browse the repository at this point in the history