Created
September 17, 2013 13:20
-
-
Save letmein/6594207 to your computer and use it in GitHub Desktop.
Postgresql ramdisk script
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/bash | |
/etc/init.d/postgresql stop | |
TMPDIR=/tmp/tmpfs; # the actual mount point for the tmpfs | |
MOUNTPOINT=/var/lib/postgresql/ | |
umount $MOUNTPOINT | |
umount $TMPDIR | |
/etc/init.d/postgresql start |
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/bash | |
/etc/init.d/postgresql stop | |
TMPDIR=/tmp/tmpfs; # the actual mount point for the tmpfs | |
MOUNTPOINT=/var/lib/postgresql/ | |
[ -d $TMPDIR ] || mkdir $TMPDIR | |
mount -t tmpfs -o size=1G,nr_inodes=20k,mode=0777 tmpfs $TMPDIR | |
rsync --archive $MOUNTPOINT/ $TMPDIR/ | |
mount -o bind $TMPDIR $MOUNTPOINT | |
/etc/init.d/postgresql start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment