Using the ccc Command Line Tool to Start, Stop, and Monitor CCC Backup Tasks

This documentation is for an older version of CCC. You can find the latest version here.
Last updated on 2020年4月24日

Carbon Copy Cloner includes a command line utility that allows you to start, stop, and monitor the progress of specific CCC backup tasks. The utility is located inside of the CCC application bundle. To get basic usage instructions, invoke the utility without arguments in the Terminal application, e.g.:

user@Mac ~ % "/Applications/Carbon Copy Cloner.app/Contents/MacOS/ccc" 
ccc -v|--version
		Prints the version of the CCC command-line utility (this is not the same as the main application version)
ccc -s"Task Name" | --start="My Backup Task" (-w|--watch)
		-w|--watch:	Keep running and print task output until the task is finished. Ignored for task groups.
ccc -x["Task Name"] | --stop[="My Backup Task"] [-r]
		Stop all tasks, or the specified task.
		By default the task is treated as if cancelled.
		Use -r to report the event (e.g. nia Notification Center and, if configured, email).
		Use another non-zero value if you would like task notifications to be sent.
ccc -h|--history [-c|-d]
		Print a summary of task history, i.e. the data you would see in the table at the top of the Task History window.
		-c prints in CSV format
		-d prints dates in seconds since Midnight Jan 1, 1970 (rather than formatting the date)
ccc -p|--print-schedules [-c|-d]
		List each task and when it will next run.
		-c prints in CSV format
		-d prints dates in seconds since Midnight Jan 1, 1970 (rather than formatting the date)
ccc -w["Task Name" | --watch[="Task name"]
		Watch task progress (press Control+C to exit)
		Specify a task name to limit task output to the indicated task
ccc -i|--status
		Print a status line for each task.
ccc -g|--global globalDefaultName [bool|int|float|string] globalDefaultValue
		Set a global default value.
ccc -g|--global globalDefaultName delete
		Delete a global default value.
ccc -n|--notification notificationTitle notificationBody
		Send a notification to the Notification Center.
ccc -z["Task Name"] | --disable[="Task Name"]
ccc -e["Task Name"] | --enable[="Task Name"]
		Disable or enable all tasks [or a specific task].
ccc -u | --uuids
		Print task names and their unique identifiers.

Here are some examples of how to use the CCC command-line tool to start and stop a task, and get its last history event:

[user:~] cd "/Applications/Carbon Copy Cloner.app/Contents/MacOS"
[user:/Applications/Carbon Copy Cloner.app/Contents/MacOS] ./ccc -s"CCC Backup Task" -w
04/24 12:52:19	: CCC Backup Task [Data copied: Zero KB, Progress: -1.000000%] Preparing...
04/24 12:52:20	: CCC Backup Task [Data copied: Zero KB, Progress: -1.000000%] Testing write responsiveness of the destination...
04/24 12:52:20	: CCC Backup Task [Data copied: 126 bytes, Progress: 0.076235%] Comparing and copying files
04/24 12:52:21	: CCC Backup Task [Data copied: 126 bytes, Progress: 1.146266%] Comparing and copying files
04/24 12:52:21	: CCC Backup Task [Data copied: 126 bytes, Progress: 1.963699%] Comparing and copying files
04/24 12:52:22	: CCC Backup Task [Data copied: 126 bytes, Progress: 3.048320%] Comparing and copying files
^C

[user:/Applications/Carbon Copy Cloner.app/Contents/MacOS] ./ccc -x"CCC Backup Task"
Stopping CCC Backup Task

[user:/Applications/Carbon Copy Cloner.app/Contents/MacOS] ./ccc -h | head -n 1
CCC Backup Task|Macintosh HD|SSD Macintosh HD Backup|4/24/20, 12:52 PM|0:19|126 bytes|Cancelled|0