Rclone Preflight Guardrails
Preflight is the non-negotiable gate for safe sync. It prevents the most common incident pattern: running sync from an empty or wrong source path.
Preflight Sequence
test -d /srv/site || exit 1
test "$(ls -A /srv/site | wc -l)" -gt 0 || exit 1
rclone lsd remote:site >/dev/null
rclone sync /srv/site remote:site/current --dry-run -vv
Guardrail Checklist
- Verify source mount and non-empty state.
- Verify destination remote path exists.
- Review dry-run delete list before execution.
Examples with Output
1. Example 1
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv
Expected output:
NOTICE: safety profile applied ()
Would transfer 46 files
2. Example 2
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --check-first
Expected output:
NOTICE: safety profile applied (--check-first)
Would transfer 52 files
3. Example 3
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --checksum
Expected output:
NOTICE: safety profile applied (--checksum)
Would transfer 58 files
4. Example 4
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --size-only
Expected output:
NOTICE: safety profile applied (--size-only)
Would transfer 64 files
5. Example 5
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --exclude "**/*.tmp"
Expected output:
NOTICE: safety profile applied (--exclude "**/*.tmp")
Would transfer 70 files
6. Example 6
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --include "**/*.md"
Expected output:
NOTICE: safety profile applied (--include "**/*.md")
Would transfer 76 files
7. Example 7
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --delete-after
Expected output:
NOTICE: safety profile applied (--delete-after)
Would transfer 82 files
8. Example 8
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --delete-after --backup-dir remote:site/rollback/$(date +%F-%H%M)
Expected output:
NOTICE: safety profile applied (--delete-after --backup-dir remote:site/rollback/$(date +%F-%H%M))
Would transfer 88 files
9. Example 9
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --transfers 4 --checkers 8
Expected output:
NOTICE: safety profile applied (--transfers 4 --checkers 8)
Would transfer 94 files
10. Example 10
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --transfers 8 --checkers 16
Expected output:
NOTICE: safety profile applied (--transfers 8 --checkers 16)
Would transfer 100 files
11. Example 11
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --max-age 7d
Expected output:
NOTICE: safety profile applied (--max-age 7d)
Would transfer 106 files
12. Example 12
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --max-size 200M
Expected output:
NOTICE: safety profile applied (--max-size 200M)
Would transfer 112 files
13. Example 13
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --log-level INFO
Expected output:
NOTICE: safety profile applied (--log-level INFO)
Would transfer 118 files
14. Example 14
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --stats 30s
Expected output:
NOTICE: safety profile applied (--stats 30s)
Would transfer 124 files
15. Example 15
Input command:
rclone sync /srv/site remote:site/current --dry-run -vv --error-on-no-transfer
Expected output:
NOTICE: safety profile applied (--error-on-no-transfer)
Would transfer 130 files