Skip to content

Instantly share code, notes, and snippets.

@shikhir-arora
Last active February 10, 2019 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shikhir-arora/560d17153688d65a4700d98c62450351 to your computer and use it in GitHub Desktop.
Save shikhir-arora/560d17153688d65a4700d98c62450351 to your computer and use it in GitHub Desktop.
[macOS] Quick script to move caches of some applications to memory (via. a APFS ramdisk volume mounted at /Volumes/ramdisk-apfs)
#!/bin/bash
CACHEDIR="/Volumes/ramdisk-apfs" # set our home path for the ramdisk-apfs as the CACHEDIR variable
#############################################################################
# Chrome Cache
/bin/rm -rvf ~/Library/Caches/Google/Chrome/*
/bin/mkdir -pv $CACHEDIR/Google/Chrome/Default
/bin/ln -v -s $CACHEDIR/Google/Chrome/Default ~/Library/Caches/Google/Chrome/Default
# Spotify Cache
/bin/rm -rvf ~/Library/Caches/com.spotify.client
/bin/mkdir -pv $CACHEDIR/Spotify
/bin/ln -v -s $CACHEDIR/Spotify ~/Library/Caches/com.spotify.client
# discordcanary Cache
/bin/rm -rvf /Users/shikhirarora/Library/Application\ Support/discordcanary/Cache
/bin/mkdir -pv $CACHEDIR/discordcanaryram/Cache
/bin/ln -v -s $CACHEDIR/discordcanaryram/Cache /Users/shikhirarora/Library/Application\ Support/discordcanary/Cache
# discordcanary localstorage
/bin/rm -rvf /Users/shikhirarora/Library/Application\ Support/discordcanary/Local\ Storage
/bin/mkdir -pv $CACHEDIR/discordcanaryram/Local\ Storage
/bin/ln -v -s $CACHEDIR/discordcanaryram/Local\ Storage /Users/shikhirarora/Library/Application\ Support/discordcanary/Local\ Storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment