Skip to content

Instantly share code, notes, and snippets.

@drobinson
Last active August 29, 2015 13:58
Show Gist options
  • Save drobinson/9980334 to your computer and use it in GitHub Desktop.
Save drobinson/9980334 to your computer and use it in GitHub Desktop.
(deprecated - look here https://gist.github.com/fbrnc/11296418)
#!/bin/bash
if [ ! -d $1/var ] ; then echo "Invalid directory $1/var"; exit 1; fi
SHMFOLDERS=( "full_page_cache" "cache" "session" )
for i in "${SHMFOLDERS[@]}" ; do
if [ ! -d $1/var/$i ] ; then echo "Invalid directory $1/var/$i"; exit 1; fi
if [ -d /dev/shm/$i ] ; then echo "Directory /dev/shm/$i already exists"; exit 1; fi
mv $1/var/$i /dev/shm/$i
ln -s /dev/shm/$i $1/var/$i
chown -R vagrant:www-data /dev/shm/$i
chmod -R ug+rw /dev/shm/$i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment