Last active
December 22, 2015 22:19
Speedup your symfony2 vagrant box by mounting the app/cache folder into the ram of the vm (run this script as root!)
This file contains hidden or 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 | |
# create mount point | |
if [ ! -d /ram ] | |
then | |
mkdir /ram | |
fi | |
# create ramfs | |
mount -t ramfs -o size=512M ramfs /ram/ | |
# remove existing cache | |
if [ -d /var/www/app/cache ] | |
then | |
rm -rf /var/www/app/cache | |
fi | |
# make shure we got the cache-dir for the symlink | |
if [ ! -d /ram/cache ] | |
then | |
mkdir /ram/cache | |
fi | |
# set proper user (you may need to modify this!) | |
chown -R www-data:www-data /ram | |
# link ram-cache into app | |
ln -s /ram/cache /var/www/app/cache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment