brctl -- Manage the CloudDocs daemon (bird)

brctl command [command-options and arguments]

log [options] [command]
-c
--color[={yes|no}]
-d
--path=logs-dir
use logs-dir instead of default
-H
--home=home-dir
use this as the ~ prefix, to look for ~/L/
-f
--filter=predicate
only show lines matching predicate
-m
--multiline[ yes|no ]
no really wide!
-n=lines number of initial lines to display
-p
--page
use paging (default ?)
-w
--wait
wait for new logs continuously (syslog -w)
-t
--shorten
Shorten UUIDs, paths, etc
-s
--digest
Only output digest logs
-u
--current-user
Filter logs for the current user only

Without options (messy) output includes:
ESC[0;1;30m[note] elapSec [ccyy-mm-dd hh:mm:ss.mmm]
30m:black; 32m:green; 33m:yellow; 39m:? reserved?

Summary without options:

   1 brc.system-resources           resources            BRCSystemResourcesManager.m:475    Memory warning received
   1 main-thread                    account              BRAccount.m:92 Took 1.90s to get the token
   2 NSFileManager.ubiquityAccountTokenNotification 
                                    account BRAccount.m:71  nil error: Error Domain=NSCocoaErrorDomain Code=4099
                "The connection to service named com.apple.bird.token was invalidated." 
                UserInfo={NSDebugDescription=The connection to service named com.apple.bird.token was invalidated.}
   2 bird.handle-account-changes    account-change-handler  BRCAccountHandler.m:388 migration to Accounts.
                framework is not done and ubiquity dataclass is off, not loading the account for (null)
   2 root.default-qos.overcommit    daemon               BRCDaemon.m:833    starting exit sequence because of received signal (Terminated: 15)
   2 root.default-qos.overcommit    daemon               BRCDaemon.m:850    exiting with code 0...
   4 brc.system-resources           resources            BRCSystemResourcesManager.m:288    Power level really becomes good
   4 main-thread                    LOGSTART             BRCDaemon.m:531    starting bird
  12 brc.system-resources           resources            BRCSystemResourcesManager.m:199    Network really becomes reachable
  15 brc.system-resources           resources            BRCSystemResourcesManager.m:199    Network really becomes unreachable
  24 reachability                   reachability-monitor BRReachabilityMonitor.m:78 Network reachability changed to reachable [R -------]
  28 reachability                   reachability-monitor BRReachabilityMonitor.m:78 Network reachability changed to unreachable [- -------]

status [containers] items not synced or applied to disk
-o
--output=file-path
redirect output to file-path
-d
--database-path=db-path
Use the database at db-path
[container] the container to be dumped

dump [options] [container] CloudDocs database

-o
--output=file-path
redirect output to file-path
-d
--database-path=db-path
Use the database at db-path
[container] the container to be dumped
brctl dump   
brctl: Unable to dump database: <NSError:0x7f8ad1c005a0(BRCloudDocsErrorDomain:2) -
     { NSDescription = "Logged out - iCloud Drive is not configured"; }
                                 >

monitor [options] container use NSMetadataQuery to monitor the container

-S
--scope=scope
restrict the NSMDQ scope to DOCS, DATA, or BOTH

diagnose [options] [diagnosis-output-path] diagnose and collect logs

-M
--collect-mobile-documents[=container]
(default: all containers)
-s
--sysdiagnose
Do not collect what's already part of sysdiagnose
-n
--name=name
Change the device name
[diagnosis-output-path] -n is ignored.
> sudo brctl diagnose --collect-mobile-documents
The iCloud Drive tool generates files that allow Apple to investigate issues
with your computer, your iCloud account and help improve related Apple products.
The generated files might contain personal information, including but not
limited to, full path names of your stored documents, your iCloud username,
computer name, and the names of other computers registered with your iCloud
account, your computer’s IP addresses, and network connection information. This
information is used by Apple in accordance with its privacy policy and is not
shared with any other company. By using this tool and sending the results to
Apple, you consent to Apple using the contents of these files to improve iCloud
and related Apple products.

Press 'Enter' to continue.

collecting logs at "/var/tmp/clouddocs-smackerpro-16.10.02-16.40.00"
- sending SIGINFO to cloudd and networkd
- collecting taskinfo... done
- collecting stacks... done
- running launchctl print... done
- collecting samples, vmmaps, heaps, leaks... (bird[329]) (cloudd[487]) (quicklookd[339]) done
- collecting filecoordination dump... done
- listing containers... done
- listing files... done
- listing caches... done
- listing session stage... done
- collecting syslog... done
- collecting crashes and spins... done
- creating root folder archive... done
- reading defaults... done
- running pcs status... done
- running passutil list... failed
- running lsregister -dump... done
- collecting package extensions... done
- copying client.db and server.db... done
- dumping daemon state... done
- dumping daemon status... done
- dumping central task scheduling status... failed
- archiving diagnose... done
- revealing in Finder... done

please attach the following file to your radar:
/var/tmp/clouddocs-smackerpro-16.10.02-16.40.00.tar.gz
Messages found in
brctl[548]: Unable to spawn a new process (argv: [/usr/local/bin/passutil, list], error: No such file or directory).
brctl[787]: SQLite[14]: cannot open file at line 34940 of [2ef4f3a5b1]
brctl[787]: SQLite[14]: [2ef4f3a5b1]:34940: (2) open(/Users/dgerman/Library/Application Support/CloudDocs/session/db/client.db) -
brctl[787]: SQLite[21]: API call with unopened database connection pointer
brctl[787]: SQLite[21]: misuse at line 137054 of [2ef4f3a5b1] Set a breakpoint at sqlite3MisuseError to debug.
brctl[548]: Unable to spawn a new process (argv: [ctsctl, list], error: No such file or directory).
See also: bird(8)