A comprehensive collection of useful bash scripts for system administration, automation, and maintenance tasks.
Frederic Bourouliou
This repository contains a collection of bash scripts designed to automate various system administration tasks, maintenance operations, and routine procedures. Each script is designed to be modular, configurable, and easy to use.
-
backup.sh
- Automated backup script for directories and databases
- Supports MySQL and PostgreSQL databases
- Uses rsync/scp for remote backups
-
log_cleaner.sh
- Automated log cleaning and archiving
- Configurable retention periods
- Compression of archived logs
-
web_deploy.sh
- Web application deployment automation
- Git integration
- Dependencies management
- Cache management
-
service_monitor.sh
- Service health monitoring
- Email/SMS alerts
- Support for systemctl services
- Port monitoring
-
dir_sync.sh
- Directory synchronization using rsync
- Support for local and remote directories
- Configurable sync options
-
disk_alert.sh
- Disk usage monitoring
- Configurable threshold alerts
- Email notifications
-
server_setup.sh
- Initial server configuration
- Package installation
- Firewall setup
- User management
-
backup_rotation.sh
- Backup retention management
- Configurable retention periods
- Automated cleanup
-
media_processor.sh
- Batch image/video processing
- Support for ImageMagick and FFmpeg
- Format conversion and optimization
-
security_audit.sh
- Quick security checks
- Configuration verification
- Package security audit
-
system_cleanup.sh
- System maintenance and cleanup
- Package cache cleanup
- Temporary files management
-
system_update.sh
- System-wide package updates
- Support for apt/yum/dnf/brew
- Update reporting
- Pre/Post update scripts
- System snapshots
-
file_search.sh
- Advanced file search capabilities
- Content search support
- Multiple export formats (CSV, JSON)
- Configurable search patterns
-
network_test.sh
- Network connectivity testing
- Bandwidth measurement
- Port scanning
- DNS resolution testing
- Detailed reporting
-
process_monitor.sh
- Process monitoring and management
- CPU and memory usage tracking
- Automatic process restart
- Historical metrics collection
- Daily reporting
-
ssl_check.sh
- SSL certificate monitoring
- Expiration alerts
- Chain validation
- Security strength assessment
- Detailed reporting
-
db_backup.sh
- Database backup automation
- Support for MySQL, PostgreSQL, MongoDB, SQLite
- Compression and encryption
- Remote storage sync
- Backup verification
-
log_manager.sh
- Centralized log management
- Log rotation and archiving
- Log analysis and reporting
- Space management
- Pattern-based analysis
-
cron_manager.sh
- Centralized cron job management
- Job validation and verification
- Backup and restore
- Template support
- Status monitoring
-
service_manager.sh
- Service lifecycle management
- Health monitoring
- Automatic restart
- Resource usage tracking
- Dependency management
- Clone the repository:
git clone [repository-url]
cd bash_scripts
- Make scripts executable:
chmod +x *.sh
- Configure the scripts:
# Edit the config files in the config/ directory
# Set up your environment variables
Each script can be run independently. Basic usage:
./script_name.sh [options]
For detailed usage of each script, use the -h or --help option:
./script_name.sh --help
- Configuration files are stored in the
config/
directory - Each script has its own configuration file (e.g.,
backup.conf
,network_test.conf
) - Environment variables can be set in
.env
file - Each script has its own configuration options
bash_scripts/
├── README.md
├── *.sh
├── config/
│ ├── backup.conf
│ ├── network_test.conf
│ ├── process_monitor.conf
│ └── ...
├── logs/
├── backups/
├── reports/
├── status/
├── templates/
└── archives/
- Bash shell (4.0 or later recommended)
- Core utilities (rsync, ssh, etc.)
- Specific requirements are listed in each script's header
- Additional tools as needed (e.g., mysqldump, pg_dump for database scripts)
This project is licensed under the MIT License - see the LICENSE file for details.