RamDisk On Macbook

  • 開啟 工序指令編寫程式

    RamDisk_1

  • 指令碼

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    do shell script "

    if ! test -e /Volumes/\"RamDisk\" ; then

    diskutil erasevolume HFS+ \"RamDisk\" `hdiutil attach -nomount ram://4194304`

    fi

    mkdir -p /Volumes/RamDisk/Google
    rm -rf /Users/UserID/Library/Caches/Google/Chrome/Default/Cache
    ln -s /Volumes/RamDisk/Google /Users/UserID/Library/Caches/Google/Chrome/Default/Cache

    mkdir -p /Volumes/RamDisk/Edge
    rm -rf '/Users/UserID/Library/Caches/Microsoft Edge/Default/Cache'
    ln -s /Volumes/RamDisk/Edge '/Users/UserID/Library/Caches/Microsoft Edge/Default/Cache'

    chflags hidden /Volumes/RamDisk/ ;killall Finder
    "
    • 4194304 : 2GB
    • /Users/UserID/Library/Caches/Google/Chrome/Default/Cache : 轉移 Google Cache 目錄到 RamDisk
    • /Users/UserID/Library/Caches/Microsoft Edge/Default/Cache: 轉移 Microsoft Edge Cache 目錄到 RamDisk
avatar