Optimize cloud sync exclusions for NAS app metadata by deciding which files are portable recovery state and which are rebuildable, machine-specific, locked, or transactionally unsafe to copy.
Do not create one rule such as “exclude every hidden file” or “sync the entire app-data directory.” A dotfile can contain essential configuration, while a normal-looking catalog.db can be a live database that generic two-way sync should not treat as an ordinary document. Classify each path by restore role first, then build exclusions from that inventory.
Inventory App Metadata by Recovery Role
For every application directory, label content as authoritative user data, portable configuration, database state, generated index, cache, thumbnail, log, temporary file, lock, secret, or machine-specific metadata. Record whether the application can recreate it and whether it must be consistent with another file or database during restore.
A 2026 classify hidden data by role separates hidden files, temporary files, OS metadata, locked application state, and user-authored dotfiles instead of treating them as one category. That is the right model for NAS app folders as well.
The related ZimaSpace troubleshooting article on cloud-sync scope and exclusions provides the operational boundary: a “complete” task is complete under its configured rules, so exclusions must be documented rather than inferred later from missing files.
Exclude Rebuildable and High-Churn State First
Good exclusion candidates include disposable caches, generated thumbnails, temporary transcoding directories, browser-style cache trees, lock files, socket files, package download caches, and verbose rotating logs that have no recovery value. Removing them reduces item count, conflict risk, cloud API work, and unnecessary remote storage.
Good exclusion candidates include disposable caches, generated thumbnails, temporary transcodes, lock files, package caches, and verbose logs that have no recovery value. Exclude only after confirming the application can recreate them safely.
Do not exclude a directory merely because its name contains cache or begins with a dot. Verify that the application can rebuild it without losing user-created metadata, search tags, album structure, or credentials.
Keep Live Databases Out of Generic Two-Way Sync
A live database can change while a sync client is reading it. A 2026 test of copying a live SQLite database shows how a file-level copy can miss committed WAL data or capture an inconsistent state. Generic two-way sync is not transaction-aware, so database recovery should use an application-aware dump, snapshot, or supported backup path.
The CloudScope analysis notes that locked and continuously modified application files can be skipped or conflict repeatedly even when their filenames look ordinary. For transactional state, “it synced after I closed the app” is still weaker than an application-aware dump, snapshot, or backup process that creates a coherent recovery point.
Export or snapshot the database through the application's supported consistency path, then sync or back up that recovery artifact. Keep the live database directory excluded from ordinary bidirectional sync unless the application explicitly supports that topology.
Protect Portable Config and Secrets With the Right Mechanism
Configuration files, Compose manifests, templates, and selected application settings may be valuable recovery inputs even when hidden. Secrets require a separate decision: a broadly readable cloud-sync target may be the wrong place for API keys, SSH material, session tokens, or environment files.
A TrueNAS community discussion of exclude patterns use exact paths illustrates why exclusion syntax should be tested against the exact relative paths produced by the sync engine rather than assumed from shell glob habits.
Also remember that ordinary cloud services may not preserve POSIX ownership, ACLs, extended attributes, hard links, or every timestamp. Protect configuration content and separately document the permissions or identity mapping required to restore it.
Stage Filter Changes and Compare Both Inventories
Test exclusions on a small non-production tree or use a dry-run/list mode where the tool supports it. Export the old rule set first, then compare included and excluded relative paths before enabling deletion or bidirectional propagation.
For every new exclusion, record the pattern, reason, owner application, whether the content is rebuildable, and which other backup protects it if it is not. This turns a future remote file-count difference into an explainable policy result instead of an incident.
After deployment, restore a portable config file, one secret through its intended secure path, and one application database from its separate backup. The cloud-sync exclusions are optimized only when they reduce churn without removing anything required to rebuild the service.
Support & Tips
More to Read

How to Match Docker Restart Policies to Databases, Workers, and Web Apps
Match restart policy to service lifecycle and exit semantics. Pair it with health and readiness checks; do not use restart loops to hide dependency...

How to Configure Container User IDs Across Multiple NAS Shares
Map each container's UID/GID to its NAS shares, use shared groups or ACLs where needed, and treat PUID/PGID as image-specific—not universal Docker settings.

How to Set Up Docker Compose Profiles for Optional Home Server Services
Leave required services unprofiled and use profiles for optional tools. Test direct targets and dependencies instead of assuming a profile starts a full stack.

