Synchronizing Repositories
Repository Synchronization
Porch periodically synchronizes with registered repositories to discover new packages and updates. You can also trigger manual synchronization when you need immediate updates.
Sync Schedule Format: Cron expressions follow the format minute hour day month weekday. For example, */10 * * * * means “every 10 minutes”.
Trigger Manual Sync
Force an immediate synchronization of a repository:
porchctl repo sync porch-test --namespace default
This command schedules a one-time sync (minimum 1-minute delay), updates packages from the repository. This sync is independent of the periodic sync schedule.
Example output:
Repository porch-test sync scheduled
Sync Multiple Repositories
Sync several repositories at once:
porchctl repo sync repo1 repo2 repo3 --namespace default
Sync All Repositories
Sync all repositories in a namespace:
porchctl repo sync --all --namespace default
Sync across all namespaces:
porchctl repo sync --all --all-namespaces
Schedule Delayed Sync
Schedule sync with custom delay:
# Sync in 5 minutes
porchctl repo sync porch-test --namespace default --run-once 5m
# Sync in 2 hours 30 minutes
porchctl repo sync porch-test --namespace default --run-once 2h30m
# Sync at specific time
porchctl repo sync porch-test --namespace default --run-once "2024-01-15T14:30:00Z"
The minimum delay is 1 minute from command execution and the spec.sync.runOnceAt field is updated in the Repository CR. This sync is independent of the existing periodic sync schedule and past timestamps are automatically adjusted to minimum delay.