Day-02 / 100 - Archive Older Files
Project Requirement In the given directory, if you find files more than a given size ex: 20MB or files older than given days ex: 10 days Compress those files and move in a ‘archive’ folder. 1. Why are we making this script? We are creating this Bash script to automate the process of managing large and old files in a given directory. Over time, directories accumulate large and outdated files, consuming unnecessary disk space. Manually identifying and archiving these files is time-consuming and inefficient. This script helps automate the process by finding files based on size and age, compressing them, and moving them to an archive folder for better storage management. 2. Purpose of the script The purpose of this script is to improve disk space management and system performance by: Identifying large files exceeding a specific size (e.g., 20MB) Finding old files that have not been modified for a specified number of days (e.g., 10 days) Compressing files to reduce storage consumption Moving archived files to a separate directory for better organization Automating cleanup to avoid manual intervention This script is useful in DevOps workflows for log file management, backup automation, and system maintenance.

Project Requirement
In the given directory, if you find files more than a given size ex: 20MB or files older than given days ex: 10 days
Compress those files and move in a ‘archive’ folder.
1. Why are we making this script?
- We are creating this Bash script to automate the process of managing large and old files in a given directory.
- Over time, directories accumulate large and outdated files, consuming unnecessary disk space. Manually identifying and archiving these files is time-consuming and inefficient.
- This script helps automate the process by finding files based on size and age, compressing them, and moving them to an archive folder for better storage management.
2. Purpose of the script
The purpose of this script is to improve disk space management and system performance by:
- Identifying large files exceeding a specific size (e.g., 20MB)
- Finding old files that have not been modified for a specified number of days (e.g., 10 days)
- Compressing files to reduce storage consumption
- Moving archived files to a separate directory for better organization
- Automating cleanup to avoid manual intervention
This script is useful in DevOps workflows for log file management, backup automation, and system maintenance.