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

Perform regular housekeeping for the servers #13

Open
Jarmos-san opened this issue Oct 2, 2024 · 0 comments
Open

Perform regular housekeeping for the servers #13

Jarmos-san opened this issue Oct 2, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Jarmos-san
Copy link
Member

The servers hosting the runners are quite prone to getting bloated overtime. These bloat, if unhandled can block the runners to work as expected. Some ways to handle this issue of accumulating bloat is to setup a CRON job which will periodically clean up the system.

Here is a script which can be setup to be invoked at set periods of time:

#!/usr/bin/env bash

# Stop and remove all Docker containers
docker stop $(docker ps --all --quiet)
docker rm $(docker ps --all --quiet)

# Remove unused Docker images, volumes, and networks
docker system prune --all --force --volumes

# Clear package manager caches
if command -v apt-get &> /dev/null; then
    sudo apt-get clean
    sudo apt-get autoremove --yes
fi

# Clear temporary directories
sudo rm --recursive --force /tmp/*

# Clear user-specific caches and temporary files
rm --recursive --force ~/.cache/*
rm --recursive --force ~/.npm
@Jarmos-san Jarmos-san added the enhancement New feature or request label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant