A robust Perl-based automation framework for running and managing automated scripts. This application provides a structured way to execute, monitor, and log the execution of various Perl scripts.
- Script Management: Configure and manage multiple scripts through YAML configuration
- Automated Execution: Run scripts automatically with proper error handling
- Comprehensive Logging: Detailed logging system with rotation and backup
- Configuration Management: Flexible configuration system using YAML
- Error Handling: Robust error handling and reporting
- Perl 5.32.1 or higher
- Required Perl modules (automatically installed during setup):
- YAML::XS
- DateTime
- Try::Tiny
- File::Path
- File::Copy
-
Clone the Repository:
git clone https://github.com/yourusername/AutoPerl.git cd AutoPerl -
Install Dependencies:
cpanm --installdeps . -
Configure Your Scripts: Edit
config/app_config.yamlto add your scripts:scripts: - name: My Script path: scripts/my_script.pl
-
Run the Application:
perl bin/run.pl
AutoPerl/
├── bin/ # Executable scripts
│ └── run.pl # Main runner script
├── config/ # Configuration files
│ └── app_config.yaml # Main configuration
├── lib/ # Core modules
│ └── AutomatedScriptingApp/
│ ├── Config.pm # Configuration management
│ ├── ScriptRunner.pm # Script execution engine
│ └── Utils.pm # Utility functions
├── logs/ # Log files
├── scripts/ # Your automation scripts
└── t/ # Test files
The application is configured through config/app_config.yaml. Here's a sample configuration:
scripts:
- name: Example Script
path: scripts/example_script.pl
- name: Another Script
path: scripts/another_script.plLogs are stored in the logs/ directory. The application automatically:
- Rotates logs when they reach the maximum size
- Maintains a configurable number of backup files
- Includes timestamps and log levels
- Create your script in the
scripts/directory - Add the script to
config/app_config.yaml - Ensure your script has proper error handling
Example script:
#!/usr/bin/env perl
use strict;
use warnings;
use AutomatedScriptingApp::Utils qw(log_message log_error);
try {
# Your script logic here
log_message("Script started");
# ... your code ...
log_message("Script completed successfully");
} catch {
log_error("Script failed: $_");
};prove -l t/-
Script Not Found:
- Verify the script path in
app_config.yaml - Ensure the script has execute permissions
- Verify the script path in
-
Permission Issues:
- Check file permissions in the
logs/directory - Ensure write access to the configuration directory
- Check file permissions in the
-
Module Not Found:
- Run
cpanm --installdeps .to install dependencies - Check Perl version with
perl -v
- Run
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.