upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/how-to/migration-scripts
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-27 12:46:26 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-27 20:38:22 +0000
commitc9ab6aef228f0a77b2997cfc6bf83d5761ab7e08 (patch)
tree8321a98b54ade0d0bbec45921de8b7d1ba904ae0 /docs/how-to/migration-scripts
parenta7d0d574b9788f71e3add39699b3a409c0f2b492 (diff)
migration analysis add since to limit log download
Diffstat (limited to 'docs/how-to/migration-scripts')
-rwxr-xr-xdocs/how-to/migration-scripts/run-migration-analysis.sh25
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=""
141OUTPUT_DIR="" 143OUTPUT_DIR=""
142DRY_RUN=false 144DRY_RUN=false
143CONTINUE_ON_ERROR=false 145CONTINUE_ON_ERROR=false
146LOG_SINCE=""
147LOG_UNTIL=""
144 148
145# Phase control 149# Phase control
146SKIP_PHASE_1=false 150SKIP_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}