A collection of production-ready Linux Shell scripts for system administration, Kubernetes cluster deployment, server provisioning, monitoring, automation, and backup management.
This repository contains a collection of Linux automation scripts designed to simplify day-to-day DevOps, Cloud, and System Administration tasks.
The scripts are organized into multiple categories including:
- Backup Automation
- Kubernetes Cluster Deployment
- Docker Installation
- Apache Installation
- Linux Monitoring
- Server Administration
These scripts are suitable for:
- Linux Administrators
- DevOps Engineers
- Cloud Engineers
- Students and Learners
- System Engineers
scripting/
│
├── backup-file/
│ ├── daily-backup.sh
│ ├── weekly-backup.sh
│ ├── monthly-backup.sh
│ └── yearly-backup.sh
│
├── kubernetes-file/
│ ├── common.sh
│ └── master.sh
│
├── installing-file/
│ ├── install-apache-webserver.sh
│ └── install-docker.sh
│
├── monitoring-file/
│ ├── cpu-monitor.sh
│ ├── memory-monitor.sh
│ └── disk-monitor.sh
│
└── README.md
| Script | Description |
|---|---|
| daily-backup.sh | Creates daily compressed backups and manages retention automatically. |
| weekly-backup.sh | Creates weekly backup archives and removes expired backups. |
| monthly-backup.sh | Creates monthly backup archives for long-term storage. |
| yearly-backup.sh | Creates yearly backup archives for disaster recovery purposes. |
| Script | Description |
|---|---|
| common.sh | Common Kubernetes setup for Master and Worker Nodes. Installs CRI-O, kubeadm, kubelet, and kubectl. |
| master.sh | Initializes Kubernetes Control Plane and installs Calico networking. |
| Script | Description |
|---|---|
| install-apache-webserver.sh | Installs and configures Apache Web Server. |
| install-docker.sh | Installs Docker Engine, Docker CLI, Containerd, and Docker Compose Plugin. |
| Script | Description |
|---|---|
| cpu-monitor.sh | Displays CPU utilization and top CPU-consuming processes. |
| memory-monitor.sh | Displays memory utilization and top memory-consuming processes. |
| disk-monitor.sh | Displays disk usage and alerts when partitions exceed threshold limits. |
Before running any script, ensure the following requirements are met:
- Linux Operating System
- Bash Shell
- Root or Sudo Privileges
- Internet Connectivity
- Git Installed
- tar Package Installed
Verify:
bash --version
git --version
tar --versiongit clone https://github.com/aadityapalsagwan/Shell-Python-Script-Files-For-Linux.gitMove into repository:
cd Shell-Python-Script-Files-For-LinuxExample:
chmod +x backup-file/monthly-backup.shor
chmod +x installing-file/install-docker.shExample:
./backup-file/monthly-backup.shor
sudo ./installing-file/install-docker.shExecute on:
- Master Node
- Worker Node(s)
chmod +x kubernetes-file/common.sh
sudo ./kubernetes-file/common.shExecute only on Master Node:
chmod +x kubernetes-file/master.sh
sudo ./kubernetes-file/master.shRun the generated join command on Worker Nodes:
sudo kubeadm join <MASTER-IP>:6443 \
--token <TOKEN> \
--discovery-token-ca-cert-hash sha256:<HASH>Install Docker Engine:
chmod +x installing-file/install-docker.sh
sudo ./installing-file/install-docker.shVerify:
docker --version
docker compose versionEdit the backup source directories inside the backup scripts:
BACKUP_SOURCES=(
"/var/www/html"
"/etc"
"/home"
)Add or remove directories according to your environment.
/backup
│
├── daily/
├── weekly/
├── monthly/
└── yearly/
Example:
server01_monthly_2026-05.tar.gz
59 23 * * * /path/to/daily-backup.sh55 23 * * 0 /path/to/weekly-backup.sh50 23 28-31 * * [ "$(date +\%d -d tomorrow)" = "01" ] && /path/to/monthly-backup.sh45 23 31 12 * /path/to/yearly-backup.sh- Production Ready Scripts
- Kubernetes Cluster Automation
- Docker Installation Automation
- Apache Web Server Installation
- Automated Backup Management
- Backup Retention Policy
- Linux Monitoring Utilities
- Easy Customization
- Beginner Friendly
- Cloud and DevOps Focused
- Cron Compatible
- Lightweight Scripts
Planned additions:
- Nginx Installation Script
- Jenkins Installation Script
- Terraform Installation Script
- MySQL Backup Script
- PostgreSQL Backup Script
- AWS CLI Installation Script
- AWS S3 Backup Integration
- Email Alerting
- Slack Notifications
- Backup Encryption
Aaditya Pal
Cloud Engineer | Linux Administrator | AWS Enthusiast
GitHub: https://github.com/aadityapalsagwan
This project is open-source and free to use for learning, development, testing, and production environments.