Last active
September 25, 2023 10:24
-
-
Save bassu/a57e93f1236d78c050c5db59ef6bdf31 to your computer and use it in GitHub Desktop.
macOS: Chrome: RAM disk for write intensive usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
SIZE=3299328 # 1.5GiB i.e. 2048 = 1MB | |
CACHE_PREFIX="${HOME}/Library/Application Support/Google/Chrome/" | |
SYNC_PREFIX=${HOME}/RAM/Chrome/ | |
rm -rf "${CACHE_PREFIX}" | |
mkdir -p "${CACHE_PREFIX}" | |
mkdir -p "${SYNC_PREFIX}" | |
device=$(hdiutil attach -nomount ram://${SIZE}) | |
newfs_hfs -v "Chrome Cache" ${device} | |
mount -o nobrowse -o noatime -t hfs ${device} "${CACHE_PREFIX}" | |
rsync -aru --exclude=.fseventsd "${SYNC_PREFIX}" "${CACHE_PREFIX}" | |
#defaults write com.google.Chrome DiskCacheSize -int 1610612736 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL=/bin/bash | |
MAILTO=$USER | |
01 */3 * * * rsync -ar --del --exclude=.fseventsd "$HOME/Library/Application Support/Google/Chrome" $HOME/RAM/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment