Jump to content

Alfred with Carbon Copy Cloner (CCC).


Recommended Posts

Hi,

 

I am using Carbon Copy Cloner to create backups via predefined tasks. These tasks define the source, destination, backup frequency etc. Can someone help me with a workflow that can be triggered using a keyword for alfred to return all Carbon Copy Cloner tasks. I can then select form the list and ccc will trigger/initiate the corresponding task.

 

FWIW, Carbon Copy Cloner has a CLI utility for eg.: running 'ccc -p' in iterm gives me the tasks list and the schedule. My main challenge is returning the task list to alfred to then select from the list. I tried using the script filter but don't know how to create the results JSON. Any help would be much appreciated. Thank you in advance.

Link to comment

@optimus1509 Rather than just bump the thread every few days, share what you have so far for the script filter, as this will be a better starting point for someone to point you in the right direction.

 

As there may not be many CCC users on the forum, share as much information as you can. For example, what's the output of the command "ccc -p" in Terminal, etc...

 

The more information you provide, and the more legwork you do towards getting the CCC part of your workflow working, the easier it'll be for others to help you out :)

 

Cheers,
Vero

Link to comment
  • 2 weeks later...

@VeroThe script filter i have simply runs this:

 

"/Applications/Carbon Copy Cloner.app/Contents/MacOS/ccc" -i | awk -F"|" '{print $1}'

 

In the terminal, the output of the above is simply a newline-separated list of just the task names in CCC as shown below.

 

Task 1

Task 2

...

..

Task n

 

Unfortuntely, i am not well versed with python, JSON etc. so i don't know how to pass the results back to alfred. Any help is appreciated, thank you.

Edited by optimus1509
corrected for missing quote.
Link to comment
  • 8 months later...

Hi optimus1509,

I'd like to get this going as well. Not a lot of coding experience here but did you get any further?

I couldn't get your command line to work above. it just returns

pipe dquote>


But, I do know that the tasks are listed in /Library/Application Support/com.bombich.ccc/MetaData.db
I can read mine with a sqlite reading program. See screenshot

Screen Shot 2021-07-28 at 3.07.22 pm.png

Link to comment

Thanks @deanishe I edited my post to include the correction.

 

I couldn’t get this working as i am not well versed with how to create Alfred results from the output of  - 

 

"/Applications/Carbon Copy Cloner.app/Contents/MacOS/ccc" -i | awk -F"|" '{print $1}'

 

above gives the tasks list currently setup in CCC5. One task per line.

 

Maybe @deanishecan help us with this? Thanks.

Link to comment
9 hours ago, optimus1509 said:

Maybe @deanishecan help us with this?

 

With showing the list in Alfred, sure, but not with making CCC do anything with them because I don't have the software.

 

If one of you can post the CCC command-line command to start a backup given its name, I can wire it all together for you.

 

Also please post the full output of this command: "/Applications/Carbon Copy Cloner.app/Contents/MacOS/ccc" -i (without the awk etc.)

 

Feel free to anonymise task names: it's the structure that I need to know.

Edited by deanishe
Link to comment

Thanks for offering to help @deanishe much appreciated.

 

The CCC command-line command to start a backup is - 

 

"/Applications/Carbon Copy Cloner.app/Contents/MacOS/ccc" -s"Task Name"

 

Above "Task Name" is one of many backup tasks configured in CCC5.

 

"/Applications/Carbon Copy Cloner.app/Contents/MacOS/ccc" -i

 

The output of the above is new-line separate tasks along with their status (pipe separated) as per below - 

 

Task 1|stopped
Task 2|stopped
Task 3|stopped

 

if a task is running there may be additional "|" separated statuses as per below - 

 

Task 1|running|-1.000000|0|Testing write responsiveness of the destination...|

Task 2|stopped
Task 3|stopped

Task 4|running|4.494382|0|Initializing file copier…|

 

For more information please refer to this link. Thanks in advance.

Link to comment

OK, cool. Some progress.

What I don't know how to do is to return the output of 

"/Applications/Carbon Copy Cloner.app/Contents/MacOS/ccc" -i | awk -F"|" '{print $1}'

to Alfred so that it could be selected by Command+1, Command+2 etc.

I presume the result needs to be formatted into JSON?

Link to comment

@alfred_jon It works perfectly for me (i.e. show me the tasks lists and i can execute them with enter) and the workflow debugger has no errors. Are you getting any output at all when you type this in terminal?

 

"/Applications/Carbon Copy Cloner.app/Contents/MacOS/ccc" -i

 

Above should show you the tasks and their statuses.

Link to comment

Hi,

Ok, looks like I have an issue with the Python install on my computer.

[14:58:43.247] Carbon Copy Cloner[Script Filter] Queuing argument '(null)'
[14:58:43.510] Carbon Copy Cloner[Script Filter] Script with argv '(null)' finished
[14:58:43.513] ERROR: Carbon Copy Cloner[Script Filter] Code 127: /Users/jon/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/7651A74B-8CD2-4780-AE5B-AFA4E9A846E6:1: ./parse.py: bad interpreter: /usr/bin/python3: no such file or directory

 

I'll have to have a look into this.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...