mirror of
https://github.com/captn3m0/Scripts.git
synced 2024-09-27 22:22:53 +00:00
36 lines
1.1 KiB
Bash
Executable File
36 lines
1.1 KiB
Bash
Executable File
#!/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"
|
|
find $PERSONAL_ROOT -maxdepth 2 -type d -iname .git | xargs -I{} bash -c "cd {}/.. && karn update"
|
|
echo "karn update"
|
|
|
|
find /home/nemo/.cache/yay -iregex '.*\.\(bz2\|tar\|zip\|deb\|xz\|part\|rpm\|gz\|zst\|AppImage\|pacman\|jar\)$' -delete
|
|
echo "Cleared yay cache"
|
|
|
|
find /home/nemo/projects/personal/aur-* -iregex '.*\.\(bz2\|tar\|zip\|deb\|tar.zst\|xz\|part\|rpm\|gz\)$' -delete
|
|
echo "Cleared personal AUR cache"
|
|
|
|
sudo pacman -Rns $(pacman -Qtdq)
|
|
echo "Removing orphan packages"
|
|
|
|
# Delete pacman cache files older than 7 days
|
|
sudo find /var/cache/pacman/pkg -maxdepth 1 -mindepth 1 -mtime +7 -delete
|
|
echo "Clearing pacman cache"
|
|
|
|
# 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"
|
|
|
|
# Sync git repositories
|
|
syncrepos
|