GithubHelp home page GithubHelp logo

zvorky / pacman-auto-update Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 5 KB

Simple script to automatically update pacman packages when AFK

License: MIT License

Shell 100.00%
auto-updater package-manager pacman systemctl

pacman-auto-update's Introduction

Pacman Auto Update

Simple script to automatically update pacman packages when AFK

The Pacman Auto Update script automates the pacman update process by periodically checking for updates during idle periods. By default, the service detects inactivity after 5 minutes and triggers a system update using the sudo pacman -Syu command.

Users can customize the idle detection threshold, update cooldown period, and inactivity verification interval according to their preferences and system requirements. This ensures that the system remains up-to-date while minimizing disruptions to user activities.
(See "Settings" session for more)

Installation

To install the Pacman Auto Update, follow these steps:

  1. Clone/Download this repository to your device.

  2. Make sure the install.sh script is executable. You can make it executable running:

    chmod +x install.sh
  3. Execute the script with root privileges:

    sudo ./install.sh
  4. The installation script will copy the script to /usr/bin/ and set up the systemd service.

  5. Once the installation is complete, the service will be enabled and will be started automatically whenever the system starts.

Usage

Pacman Auto Update runs as a systemctl service. And you can:

Start/Stop

  • Temporarily stop the auto update by using:
    systemctl stop pacman-auto-update.service
    
  • Start again with:
    systemctl start pacman-auto-update.service
    

Enable/Disable

  • You can also disable it from running with system startup:
    systemctl disable pacman-auto-update.service
    
  • And enable again with:
    systemctl enable pacman-auto-update.service
    

Settings

You can edit both the installed script at /usr/bin/pacman-auto-update or the pacman-auto-update file you cloned (just remember to run again the install.sh script).

Setting Default Unit == Description
MAX_INACTIVITY 300000 ms 5m The maximum duration of inactivity before triggering an update.
UPDATE_COOLDOWN 10800 s 3h The delay before starting to check for updates again after an update has been performed.
CHECK_COOLDOWN 60 s 1m The delay between successive checks for system inactivity.

Uninstalling

To completely uninstall Pacman Auto Update run:

sudo systemctl stop pacman-auto-update.service
sudo systemctl disable pacman-auto-update.service
sudo rm /etc/systemd/system/pacman-auto-update.service
sudo rm /usr/bin/pacman-auto-update

⚠️ Recommendations

  • Monitor system behavior:
    Although the service automates the update process, it's still crucial to keep an eye on your system after updates to ensure that everything is functioning as expected. Automated updates can sometimes lead to unexpected issues, so regular monitoring is recommended.

  • Limited network bandwidth:
    Automatic updates can significantly consume network bandwidth, especially if you have a limited or capped internet connection. Large updates, such as those involving system upgrades or downloading multiple packages, may strain your network resources and slow down other internet-dependent activities. Before enabling the automatic update service, ensure that your network infrastructure can accommodate the additional traffic without causing inconvenience or exceeding data usage limits. Alternatively, consider scheduling updates during off-peak hours to minimize network congestion and optimize bandwidth utilization.

  • Critical system configurations:
    If your system requires specific configurations or dependencies that could be affected by updates, it's advisable to carefully consider whether installing the automatic update script is appropriate. Automatic updates may inadvertently modify critical components of your system, potentially leading to compatibility issues or unexpected behavior. In such cases, it may be preferable to manually manage updates to maintain control over the update process and minimize the risk of disruptions.


License

This project is licensed under the MIT License - see the LICENSE file for details.

pacman-auto-update's People

Contributors

zvorky avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.