Skip to content

Instantly share code, notes, and snippets.

@nosada
Last active December 28, 2025 10:34
Show Gist options
  • Select an option

  • Save nosada/95c030d2fcea5ba536951e5568994053 to your computer and use it in GitHub Desktop.

Select an option

Save nosada/95c030d2fcea5ba536951e5568994053 to your computer and use it in GitHub Desktop.
Handy script for the person that using Arch box, Nginx and mkosi to earn disk spaces
#!/bin/bash
rm -rf /var/cache/nginx/*
rm -rf /var/cache/mkosi/*
pacman -Scc --noconfirm
mv /var/log/nginx/access.log /var/log/nginx/access.log.$(date '+%Y%m%d')
gzip /var/log/nginx/access.log.$(date '+%Y%m%d')
systemctl restart nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment