Fresh start - excluded large ROM JSON files
This commit is contained in:
36
scripts/sync-obsidian.ps1
Normal file
36
scripts/sync-obsidian.ps1
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env powershell
|
||||
# sync-obsidian.ps1 - Syncs OpenClaw config and memory to Obsidian
|
||||
# Runs via cron daily
|
||||
|
||||
$date = Get-Date -Format "yyyy-MM-dd"
|
||||
$vaultPath = "C:\Users\admin\Documents\Corey\OpenClaw"
|
||||
$workspacePath = "C:\Users\admin\.openclaw\workspace"
|
||||
|
||||
# Ensure directory exists
|
||||
if (!(Test-Path $vaultPath)) {
|
||||
New-Item -ItemType Directory -Path $vaultPath -Force | Out-Null
|
||||
}
|
||||
|
||||
# Copy TOOLS.md to Obsidian (Discord config section is there)
|
||||
Copy-Item "$workspacePath\TOOLS.md" "$vaultPath\Tools Reference.md" -Force
|
||||
|
||||
# Copy MEMORY.md
|
||||
Copy-Item "$workspacePath\MEMORY.md" "$vaultPath\MEMORY Index.md" -Force -ErrorAction SilentlyContinue
|
||||
|
||||
# Create daily sync note
|
||||
$syncContent = @"
|
||||
# OpenClaw Sync - $date
|
||||
|
||||
## Files Synced
|
||||
- Tools Reference.md (from TOOLS.md)
|
||||
- MEMORY Index.md (from MEMORY.md)
|
||||
|
||||
## Notes
|
||||
Last updated: $((Get-Date).ToString('HH:mm'))
|
||||
|
||||
---
|
||||
"@
|
||||
|
||||
$syncContent | Out-File -FilePath "$vaultPath\Sync History $date.md" -Encoding utf8
|
||||
|
||||
Write-Host "Obsidian sync completed at $((Get-Date).ToString('yyyy-MM-dd HH:mm:ss'))"
|
||||
Reference in New Issue
Block a user