WIP: Oracle DR CUMULATIVE backup upgrade - Phases 1-3 completed
COMPLETED: - Phase 1: Proxmox host storage (/mnt/pve/oracle-backups/ROA/autobackup) - Phase 2: RMAN script already has CUMULATIVE keyword - Phase 3: Transfer scripts updated for Proxmox host * transfer_incremental.ps1: 10.0.20.37:22122 → 10.0.20.202:22 * transfer_to_dr.ps1: Same change * Converted Windows PowerShell to Linux bash commands - VM 109 cleanup: ~6.4 GB freed, RMAN catalog cleaned NEW FILES: - copy_existing_key_to_proxmox.ps1: Setup script for SSH key - setup_ssh_keys_for_proxmox.ps1: Alternative setup (not used) PENDING (Next Session): - Run copy_existing_key_to_proxmox.ps1 on PRIMARY as Administrator - Phase 4: Modify scheduled tasks (13:00 + 18:00) - Phase 5: Configure mount point on VM 109 (F:\ drive) - Phase 6: Update restore script for F:\ mount - Phase 7: Test FULL + CUMULATIVE backup and restore DOCUMENTATION: - DR_UPGRADE_TO_CUMULATIVE_PLAN.md: Added implementation status 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
78
input/copy_existing_key_to_proxmox.ps1
Normal file
78
input/copy_existing_key_to_proxmox.ps1
Normal file
@@ -0,0 +1,78 @@
|
||||
# Copy Existing SSH Key to Proxmox
|
||||
# Rulează acest script pe PRIMARY ca Administrator
|
||||
#
|
||||
# Acest script copiază cheia publică SSH existentă din profilul SYSTEM pe Proxmox
|
||||
|
||||
param(
|
||||
[string]$ProxmoxHost = "10.0.20.202",
|
||||
[string]$ProxmoxUser = "root"
|
||||
)
|
||||
|
||||
Write-Host "=========================================" -ForegroundColor Cyan
|
||||
Write-Host "Copiere Cheie SSH Existentă → Proxmox DR" -ForegroundColor Cyan
|
||||
Write-Host "=========================================" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
$SystemSSHDir = "C:\Windows\System32\config\systemprofile\.ssh"
|
||||
$PublicKeyPath = "$SystemSSHDir\id_rsa.pub"
|
||||
$PrivateKeyPath = "$SystemSSHDir\id_rsa"
|
||||
|
||||
# Verifică dacă cheia există
|
||||
if (-not (Test-Path $PublicKeyPath)) {
|
||||
Write-Host "✗ Cheia publică nu există: $PublicKeyPath" -ForegroundColor Red
|
||||
Write-Host " Scriptul trebuie rulat ca Administrator!" -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "✓ Cheie publică găsită: $PublicKeyPath" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Write-Host "→ Copiez cheia publică pe Proxmox ($ProxmoxHost)..." -ForegroundColor Yellow
|
||||
Write-Host " IMPORTANT: Vei fi întrebat de parola root pentru Proxmox!" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
# Metodă simplă: folosim SCP pentru a copia fișierul temporar, apoi cat
|
||||
$tempFile = "C:\Windows\Temp\temp_pubkey.pub"
|
||||
Copy-Item $PublicKeyPath $tempFile -Force
|
||||
|
||||
# Copiază fișierul pe Proxmox
|
||||
& scp $tempFile "${ProxmoxUser}@${ProxmoxHost}:/tmp/temp_pubkey.pub"
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "✗ Eroare la copierea fișierului cu SCP" -ForegroundColor Red
|
||||
Remove-Item $tempFile -Force -ErrorAction SilentlyContinue
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adaugă cheia în authorized_keys
|
||||
& ssh "${ProxmoxUser}@${ProxmoxHost}" "mkdir -p /root/.ssh; chmod 700 /root/.ssh; cat /tmp/temp_pubkey.pub >> /root/.ssh/authorized_keys; chmod 600 /root/.ssh/authorized_keys; rm /tmp/temp_pubkey.pub; echo 'SSH key added'"
|
||||
|
||||
Remove-Item $tempFile -Force -ErrorAction SilentlyContinue
|
||||
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✓ Cheie publică copiată pe Proxmox!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "✗ Eroare la adăugarea cheii în authorized_keys" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "→ Testez conexiunea SSH fără parolă..." -ForegroundColor Yellow
|
||||
|
||||
# Testează conexiunea (cu cheia din profilul SYSTEM)
|
||||
$testResult = & ssh -o StrictHostKeyChecking=no -i $PrivateKeyPath "${ProxmoxUser}@${ProxmoxHost}" "echo 'SSH connection OK'" 2>&1
|
||||
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✓ Conexiune SSH funcționează fără parolă!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "✗ Conexiunea SSH nu funcționează direct din acest cont" -ForegroundColor Yellow
|
||||
Write-Host " Dar cheia a fost adăugată - scheduled tasks (SYSTEM) ar trebui să funcționeze" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "=========================================" -ForegroundColor Green
|
||||
Write-Host "✓ Setup complet!" -ForegroundColor Green
|
||||
Write-Host "=========================================" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Write-Host "Cheia din profilul SYSTEM: $PrivateKeyPath" -ForegroundColor Cyan
|
||||
Write-Host "Scheduled tasks vor folosi această cheie automat." -ForegroundColor Yellow
|
||||
Write-Host ""
|
||||
Reference in New Issue
Block a user