Overview
When experiencing high RAM usage on an Exinda appliance, it may be necessary to clear the cache to improve performance. Directly executing Linux commands to clear the cache is not recommended due to potential system instability. Instead, setting up a cron job to automate cache clearing using a script in the restricted shell is advised. This article provides the steps to create and schedule such a job.
Information
To set up a cron job for cache clearing on your Exinda appliance, follow these steps:
-
Access the Restricted Shell:
- Enter the restricted CLI by typing
en_shell.
- Enter the restricted CLI by typing
-
Create a Shell Script:
- Navigate to the bin directory:
cd /bin/. - Create a new shell script file:
touch clearcache.sh. - Open the file in the vi editor:
vi clearcache.sh. - Press
Ito enter edit mode and add the following line: -
#!/bin/bash echo "echo 3 > /proc/sys/vm/drop_caches" - Press
Escto exit edit mode and type:wq!to save and quit.
- Navigate to the bin directory:
-
Set Execute Permissions:
- Make the script executable:
chmod 755 clearcache.sh.
- Make the script executable:
-
Create a Cron Job:
- Navigate to the home directory:
cd ~. - Create a cron job file:
touch clearcache.cron. - Open the file in the vi editor:
vi clearcache.cron. - Press
Ito enter edit mode and add the following line to schedule the script to run daily at 2 AM: -
0 2 * * * /path/to/clearcache.sh - Press
Escto exit edit mode and type:wq!to save and quit.
- Navigate to the home directory:
-
Add the Cron Job:
- Return to shell mode:
en_shell. - Add the cron job:
crontab -u admin ~/clearcache.cron.
- Return to shell mode:
-
Verify the Cron Job:
- Check if the cron job was added successfully:
crontab -l.
- Check if the cron job was added successfully:
Ensure you have a backup of your Exinda configuration before proceeding. A restricted shell license is required to access the restricted shell and create this job. Proceed with caution as changes in the restricted shell are not supported.
Frequently Asked Questions
- What is the purpose of setting up a cron job for cache clearing?
- Setting up a cron job automates the process of clearing the cache, which can help manage high RAM usage and improve the performance of your Exinda appliance.
- Can I execute the cache clearing command directly on the Exinda appliance?
- Directly executing the command
sync; echo 3 > /proc/sys/vm/drop_cachesis not recommended as it may lead to system instability. It is safer to automate the process using a cron job. - What should I do before setting up the cron job?
- Ensure you have a current backup of your Exinda configuration and obtain a restricted shell license if needed. Be aware of the potential impact on your monitoring data.
Priyanka Bhotika
Comments