/Memory-Monitoring-Script

This script continuously monitors memory usage and logs it into a specified log file at regular intervals.

Primary LanguageShellGNU General Public License v3.0GPL-3.0

Memory-Monitoring-Script

This script continuously monitors memory usage and logs it into a specified log file at regular intervals.

How It Works

-> Timestamp: The script logs the current date and time along with the memory usage percentage.
-> Memory Usage Calculation: The script uses the free -m command to get memory usage information. It extracts the total and used memory, calculates the used memory percentage, and formats it for logging.
-> Continuous Monitoring: The script runs indefinitely, logging the memory usage at regular intervals specified by the INTERVAL variable.
-> Log File Creation: The script ensures that the directory for the log file exists, creating it if necessary.