Skip to content

yogeshakn1k95/Project1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Project1

This project includes Bash scripts to monitor and archive basic system metrics such as CPU usage, memory, disk space, uptime, and load average.

πŸ“œ Scripts

1. collect_metrics.sh

  • Collects system metrics:
    • CPU usage
    • Memory usage
    • Disk usage
    • System uptime
    • Load average
  • Saves the output to a timestamped text file in the reports/ directory: /home/ec2-user/Project1/reports/metrics_${TIMESTAMP}.txt ex: /home/ec2-user/Project1/reports/metrics_2025-10-20 16:15:01.txt

2. archive_metrics.sh

  • Archives all metric report files for the current day into a compressed .tar.gz file in the archive/ directory: /home/ec2-user/Project1/archive/metrics_${TIMESTAMP}.tar.gz ex: /home/ec2-user/Project1/archive/metrics_2025-10-20_15-04-36.tar.gz

⏰ Cron Jobs

Every 15 minutes – Collect metrics:

crontab -e */15 * * * * * bash /home/ec2-user/Project1/scripts/collect_metrics.sh

Every day at 11:59 PM – Archive daily reports:

59 23 * * * bash /home/ec2-user/Project1/scripts/archive_metrics.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages