Skip to content

Instantly share code, notes, and snippets.

@Eddy-Barraud
Created May 16, 2018 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Eddy-Barraud/8317b5fe5e05f496d7e82e78d99c7e78 to your computer and use it in GitHub Desktop.
Save Eddy-Barraud/8317b5fe5e05f496d7e82e78d99c7e78 to your computer and use it in GitHub Desktop.
Sync ram disk with hard disk & mount it
mkdir /ramdisk
mount -t tmpfs -o size=2048M tmpfs /ramdisk
or copy inside /etc/fstab
tmpfs /media/ramdisk tmpfs rw,size=2048M 0 0
And do :
mount -a
#!/bin/sh
cp -ar /var/www/html/ /ramdisk/
chown -R www-data /ramdisk/html
while true
do
rsync -a --delete /ramdisk/html /var/www/
#chown -R www-data /ramdisk/html
sleep 300;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment