scripts/housekeeping

36 lines
1.1 KiB
Plaintext
Raw Normal View History

2018-08-02 02:52:06 +00:00
#!/bin/bash
# Run karn on all work projects so that my git identities are correct
WORK_ROOT="/home/nemo/projects/work/razorpay"
find $WORK_ROOT -maxdepth 2 -type d -iname .git | xargs -I{} bash -c "cd {}/.. && karn update"
PERSONAL_ROOT="/home/nemo/projects/personal"
2018-10-21 12:40:17 +00:00
find $PERSONAL_ROOT -maxdepth 2 -type d -iname .git | xargs -I{} bash -c "cd {}/.. && karn update"
2021-04-18 09:27:20 +00:00
echo "karn update"
2018-10-21 12:40:17 +00:00
2021-06-04 09:40:01 +00:00
find /home/nemo/.cache/yay -iregex '.*\.\(bz2\|tar\|zip\|deb\|xz\|part\|rpm\|gz\|zst\|AppImage\|pacman\|jar\)$' -delete
2021-04-18 09:27:20 +00:00
echo "Cleared yay cache"
2021-01-02 09:33:25 +00:00
2021-06-23 13:28:00 +00:00
find /home/nemo/projects/personal/aur-* -iregex '.*\.\(bz2\|tar\|zip\|deb\|tar.zst\|xz\|part\|rpm\|gz\|tgz\)$' -delete
2021-04-18 09:27:20 +00:00
echo "Cleared personal AUR cache"
2021-01-02 09:33:25 +00:00
2019-01-01 18:56:43 +00:00
sudo pacman -Rns $(pacman -Qtdq)
2021-04-18 09:27:20 +00:00
echo "Removing orphan packages"
2019-01-01 18:56:43 +00:00
# Delete pacman cache files older than 7 days
sudo find /var/cache/pacman/pkg -maxdepth 1 -mindepth 1 -mtime +7 -delete
2021-04-18 09:27:20 +00:00
echo "Clearing pacman cache"
2018-12-25 09:24:25 +00:00
# Clear systemd logs
sudo journalctl --vacuum-size=100M
# Clear docker stuff
sudo docker system prune -af
## KEEP ALL NETWORK RELATED STUFF BELOW THIS
echo "Going to try stuff that needs network access now"
2019-05-07 07:45:07 +00:00
# Sync git repositories
syncrepos