المهارات Linux Production Shell Scripts
📦

Linux Production Shell Scripts

مخاطر منخفضة ⚙️ الأوامر الخارجية🌐 الوصول إلى الشبكة📁 الوصول إلى نظام الملفات

Create Production Shell Scripts for Linux Automation

System administrators need reliable, tested scripts for routine tasks without writing from scratch. This skill provides production-ready bash templates for backups, monitoring, user management, and automation with best practices built in.

يدعم: Claude Codex Code(CC)
📊 70 كافٍ
1

تنزيل ZIP المهارة

2

رفع في Claude

اذهب إلى Settings → Capabilities → Skills → Upload skill

3

فعّل وابدأ الاستخدام

اختبرها

استخدام "Linux Production Shell Scripts". Create a script to monitor disk usage and alert when it exceeds 90%

النتيجة المتوقعة:

A complete bash script with disk usage monitoring, threshold checking, alert notification via email, and logging functionality. The script includes proper error handling, variable documentation, and can be scheduled via cron for automated execution.

استخدام "Linux Production Shell Scripts". Generate a backup script for MySQL database with rotation

النتيجة المتوقعة:

Production-ready script that performs mysqldump with credentials handling, gzip compression, timestamped filenames, automatic deletion of backups older than 7 days, and detailed logging. Includes usage instructions and configuration section.

التدقيق الأمني

مخاطر منخفضة
v1 • 2/25/2026

Static analyzer flagged 170 patterns but evaluation confirms these are FALSE POSITIVES. The skill contains legitimate bash scripting templates for system administration. Command substitution, sudo usage, and /proc access are expected patterns for educational shell scripts. No malicious intent detected. Minor warnings apply due to sudo privilege escalation patterns which should be documented for users.

1
الملفات التي تم فحصها
505
الأسطر التي تم تحليلها
6
النتائج
1
إجمالي عمليات التدقيق
مشكلات منخفضة المخاطر (3)
Sudo Privilege Escalation
Scripts use sudo for package installation and service management. Legitimate for system administration but requires user awareness of privilege requirements.
System File Access
Scripts read /etc/passwd for user management and /proc/loadavg for system monitoring. These are world-readable system files used legitimately.
Cron Job Modification
Script demonstrates crontab modification for task scheduling. Legitimate automation functionality but users should understand cron security implications.

عوامل الخطر

⚙️ الأوامر الخارجية (1)
🌐 الوصول إلى الشبكة (1)
📁 الوصول إلى نظام الملفات (1)
تم تدقيقه بواسطة: claude

درجة الجودة

38
الهندسة المعمارية
100
قابلية الصيانة
87
المحتوى
50
المجتمع
84
الأمان
78
الامتثال للمواصفات

ماذا يمكنك بناءه

Automated Backup System

Set up automated daily backups of critical directories with rsync to remote servers, automatic rotation to keep only recent backups, and database dumps for complete disaster recovery.

Server Health Monitoring

Deploy monitoring scripts to track CPU, disk, and memory usage with configurable alert thresholds. Generate daily health reports and receive notifications when resources exceed limits.

User Account Lifecycle Management

Automate user provisioning with account creation scripts, generate password expiry reports for compliance audits, and bulk-manage accounts across the organization.

جرّب هذه الموجهات

Basic Backup Script
Create a bash script to backup the /var/www directory to /backup daily, keeping only the last 7 backups. Include timestamped filenames and error handling.
System Monitoring Dashboard
Generate a monitoring script that checks CPU usage, disk space, and memory. Send an alert email to admin@example.com when any metric exceeds 85%. Log all readings to a file with timestamps.
Database Backup Automation
Write a script to backup all MySQL databases, compress each dump file, upload to an S3 bucket, and delete local copies older than 14 days. Include error handling and logging.
Server Fleet Health Report
Create a script that connects to multiple servers via SSH, collects system information (hostname, OS, CPU, memory, disk), and generates a consolidated HTML report. Include uptime and top processes for each server.

أفضل الممارسات

  • Always test scripts in non-production environments before deploying to production servers
  • Use absolute paths in scripts to avoid failures when executed from different directories
  • Quote all variables to handle paths and values containing spaces or special characters

تجنب

  • Do not hardcode passwords or API keys in scripts - use environment variables or secure secret management
  • Avoid running scripts as root unless absolutely necessary - use sudo for specific commands instead
  • Never skip error checking - always verify command success with proper exit code handling

الأسئلة المتكررة

How do I make these scripts executable?
Run chmod +x script_name.sh to make the script executable, then run it with ./script_name.sh. Alternatively, run bash script_name.sh without changing permissions.
Do I need root privileges to run these scripts?
Some scripts require elevated privileges for operations like user management, package installation, or service control. Scripts using sudo will prompt for your password. Test each script to understand its permission requirements.
Can I schedule these scripts to run automatically?
Yes, use cron to schedule scripts. Run crontab -e and add entries like '0 2 * * * /path/to/script.sh' to run daily at 2 AM. The skill includes examples of cron setup.
How do I customize these scripts for my environment?
Each script has configuration variables at the top (paths, thresholds, credentials). Modify these values to match your environment. Always test in a safe environment before production use.
What if a script fails or produces errors?
Run scripts with bash -x script.sh to enable debug mode and see each command as it executes. Check system logs at /var/log/syslog for service-related errors. Ensure all required utilities are installed.
Are these scripts compatible with all Linux distributions?
Most scripts work on any bash-compatible Linux system. Package management commands (apt-get) are Debian/Ubuntu specific. For RHEL/CentOS, replace with yum or dnf equivalents. The skill notes distribution-specific commands where applicable.

تفاصيل المطور

بنية الملفات

📄 SKILL.md