On some of my servers, especially those that get traffic from facebook ads, they stay out of the air while. When I see this happening, I need to go to VPSSIM and give it a Clear All Cache. After that, the sites return to normal functioning. Is there any way for the server to do this clear all automatic caching from time to time, or some plugin that I install and do this?
You can create a bash /home/clearcache.sh
Code: Select all
Content:nano /home/clearcache.sh
Code: Select all
Save and make it can run#!/bin/bash
service nginx restart
service php-fpm restart
# ( echo "flushall" ) | redis-cli #Clear Redis Cache / uncomment to use command
# echo "flush_all" | nc 127.0.0.1 11211 #Clear Memcached Cache / uncomment to use command
Code: Select all
And using Cronjob Manage in VPSSIM menu to add this to cronjobchmod +x /home/clearcache.sh
Code: Select all
* */12 * * * root /home/clearcache.sh
========================================================================= VPSSIM - Manage VPS/Server by VPSSIM.COM ========================================================================= Cronjob Manage ========================================================================= Cronjob running: 1 ========================================================================= How to use: http://go.hostingaz.vn/howcronjob ========================================================================= 1) Add Cronjob 4) Backup All Current Cronjobs 2) Delete Cronjob 5) Restore Cronjob From Backup File 3) Clear All Cronjobs 6) Cronjob running Type in your choice (0-Exit): 1 ========================================================================= Example: To add Cronjob: * */5 * * * /root/backup.sh ------------------------------------------------------------------------- You must type in: * */5 * * * /root/backup.sh ------------------------------------------------------------------------- Type in Cronjob [ENTER]: * */12 * * * root /home/clearcache.shThis cronjob run every 12 hours