I'm trying to move caches and index directories from the IntelliJ IDEA config dir to RAM mount point in /tmp using symbolic links.
I've added: tmpfs /tmp/ramdisk tmpfs defaults,size=1024M,x-gvfs-show,mode=1777 0 0 to /etc/fstab, and replaced caches and index directories in the intellij config directory with symbolic links pointing to the ram mount point with:
$ mkdir /tmp/ramdisk/intellij/caches
$ mkdir /tmp/ramdisk/intellij/index
$ ln -s /tmp/ramdisk/intellij/caches caches #inside intellij config/system dir
$ ln -s /tmp/ramdisk/intellij/index index #inside intellij config/system dir
The problem is, on every reboot the mount directories will be deleted from /tmp and before mounting I will need to re-create them, otherwise I will get an error mount: /tmp/ramdisk: mount point does not exist.
I will also need to re-create caches and index directories or the symbolic links won't work
Is there a better way to do this?