Update README.md
This commit is contained in:
parent
fe56436a81
commit
1b155193f8
1 changed files with 57 additions and 1 deletions
58
README.md
58
README.md
|
@ -1,2 +1,58 @@
|
|||
# proxmox-snapshot-rotation
|
||||
The script does the following:
|
||||
|
||||
1. Comprehensive Logging System:
|
||||
- Dedicated log directory and rotation
|
||||
- Configurable log file size limits
|
||||
- Different log levels (INFO, WARN, ERROR)
|
||||
- Verbose mode option
|
||||
- Log rotation when size limit is reached
|
||||
|
||||
2. Robust Error Handling:
|
||||
- Error codes for different failure scenarios
|
||||
- Detailed error messages with timestamps
|
||||
- Temporary file handling for error capture
|
||||
- Proper cleanup of temporary files
|
||||
- Error handling for all critical operations
|
||||
|
||||
3. Process Management:
|
||||
- Lock file mechanism to prevent multiple instances
|
||||
- Proper cleanup of lock file using trap
|
||||
- Stale lock detection and cleanup
|
||||
|
||||
4. Input Validation:
|
||||
- Parameter validation for numeric inputs
|
||||
- Better argument parsing
|
||||
- Clear help message with usage examples
|
||||
|
||||
5. Safety Features:
|
||||
- Separate functions for snapshot creation and deletion
|
||||
- Better status checking and error reporting
|
||||
- Verbose logging option for debugging
|
||||
- Dry-run mode improvements
|
||||
|
||||
6. Code Organization:
|
||||
- Modular function design
|
||||
- Clear separation of concerns
|
||||
- Constants and configuration at the top
|
||||
- Main function to orchestrate operations
|
||||
- Better variable naming and scope management
|
||||
|
||||
To use the script:
|
||||
|
||||
1. Save it to a location like `/usr/local/sbin/proxmox-snapshot-rotation.sh`
|
||||
2. Make it executable: `chmod +x /usr/local/sbin/proxmox-snapshot-rotation.sh`
|
||||
3. Create the log directory: `mkdir -p /var/log/proxmox-snapshots`
|
||||
|
||||
You can run it with various options:
|
||||
```bash
|
||||
# Normal run
|
||||
./proxmox-snapshot-rotation.sh
|
||||
|
||||
# Dry run with verbose output
|
||||
./proxmox-snapshot-rotation.sh --dry-run --verbose
|
||||
|
||||
# Keep more snapshots and longer retention
|
||||
./proxmox-snapshot-rotation.sh --keep 48 --retain-days 14
|
||||
```
|
||||
|
||||
The script will create detailed logs in `/var/log/proxmox-snapshots/` and handle various error conditions gracefully.
|
Loading…
Reference in a new issue