Skip to content

Instantly share code, notes, and snippets.

@magenx
Last active August 29, 2015 13:57
Show Gist options
  • Save magenx/9604368 to your computer and use it in GitHub Desktop.
Save magenx/9604368 to your computer and use it in GitHub Desktop.
Clear apc cache
#!/bin/bash
myip=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
## monitor app folder and clear apc/opcode cache
/usr/bin/inotifywait -e modify \
-mrq /var/www/html/magento/app | while read line; do
echo -n "$line " >> /var/log/app_monitor.log
echo `date | cut -d " " -f1-4` >> /var/log/app_monitor.log
wget -O /dev/null http://$myip/apc_opcache/apc_clear.php >/dev/null 2>&1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment