diff options
Diffstat (limited to 'docs/how-to/migration-scripts/run-migration-analysis.sh')
| -rwxr-xr-x | docs/how-to/migration-scripts/run-migration-analysis.sh | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/docs/how-to/migration-scripts/run-migration-analysis.sh b/docs/how-to/migration-scripts/run-migration-analysis.sh index b2ca142..089b553 100755 --- a/docs/how-to/migration-scripts/run-migration-analysis.sh +++ b/docs/how-to/migration-scripts/run-migration-analysis.sh | |||
| @@ -28,6 +28,8 @@ | |||
| 28 | # --archive-git <path> Git base directory for archive (enables Phase 2) | 28 | # --archive-git <path> Git base directory for archive (enables Phase 2) |
| 29 | # --service <name> Systemd service name for log extraction (enables Phase 4) | 29 | # --service <name> Systemd service name for log extraction (enables Phase 4) |
| 30 | # --output <dir> Output directory (default: work/migration-analysis-YYYYMMDD-HHMM) | 30 | # --output <dir> Output directory (default: work/migration-analysis-YYYYMMDD-HHMM) |
| 31 | # --since <date> Start date for log extraction (default: 30 days ago) | ||
| 32 | # --until <date> End date for log extraction (default: now) | ||
| 31 | # | 33 | # |
| 32 | # PHASE CONTROL: | 34 | # PHASE CONTROL: |
| 33 | # --skip-phase-1 Skip event fetching (use existing data) | 35 | # --skip-phase-1 Skip event fetching (use existing data) |
| @@ -141,6 +143,8 @@ SERVICE_NAME="" | |||
| 141 | OUTPUT_DIR="" | 143 | OUTPUT_DIR="" |
| 142 | DRY_RUN=false | 144 | DRY_RUN=false |
| 143 | CONTINUE_ON_ERROR=false | 145 | CONTINUE_ON_ERROR=false |
| 146 | LOG_SINCE="" | ||
| 147 | LOG_UNTIL="" | ||
| 144 | 148 | ||
| 145 | # Phase control | 149 | # Phase control |
| 146 | SKIP_PHASE_1=false | 150 | SKIP_PHASE_1=false |
| @@ -223,6 +227,14 @@ parse_args() { | |||
| 223 | CONTINUE_ON_ERROR=true | 227 | CONTINUE_ON_ERROR=true |
| 224 | shift | 228 | shift |
| 225 | ;; | 229 | ;; |
| 230 | --since) | ||
| 231 | LOG_SINCE="$2" | ||
| 232 | shift 2 | ||
| 233 | ;; | ||
| 234 | --until) | ||
| 235 | LOG_UNTIL="$2" | ||
| 236 | shift 2 | ||
| 237 | ;; | ||
| 226 | --help|-h) | 238 | --help|-h) |
| 227 | usage | 239 | usage |
| 228 | ;; | 240 | ;; |
| @@ -578,8 +590,17 @@ run_phase_4() { | |||
| 578 | 590 | ||
| 579 | local cmds=() | 591 | local cmds=() |
| 580 | 592 | ||
| 581 | cmds+=("'$SCRIPT_DIR/30-extract-parse-failures.sh' '$SERVICE_NAME' '$OUTPUT_DIR/logs'") | 593 | # Build log extraction options |
| 582 | cmds+=("'$SCRIPT_DIR/31-extract-purgatory-expiry.sh' '$SERVICE_NAME' '$OUTPUT_DIR/logs'") | 594 | local log_opts="" |
| 595 | if [[ -n "$LOG_SINCE" ]]; then | ||
| 596 | log_opts="$log_opts --since '$LOG_SINCE'" | ||
| 597 | fi | ||
| 598 | if [[ -n "$LOG_UNTIL" ]]; then | ||
| 599 | log_opts="$log_opts --until '$LOG_UNTIL'" | ||
| 600 | fi | ||
| 601 | |||
| 602 | cmds+=("'$SCRIPT_DIR/30-extract-parse-failures.sh' '$SERVICE_NAME' '$OUTPUT_DIR/logs' $log_opts") | ||
| 603 | cmds+=("'$SCRIPT_DIR/31-extract-purgatory-expiry.sh' '$SERVICE_NAME' '$OUTPUT_DIR/logs' $log_opts") | ||
| 583 | 604 | ||
| 584 | run_phase 4 "Extract Logs (VPS required)" "${cmds[@]}" | 605 | run_phase 4 "Extract Logs (VPS required)" "${cmds[@]}" |
| 585 | } | 606 | } |