optimus1509 Posted October 15, 2020 Share Posted October 15, 2020 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 Posted October 19, 2020 Author Share Posted October 19, 2020 Folks, any tips on this please? Link to comment
Vero Posted October 19, 2020 Share Posted October 19, 2020 @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
optimus1509 Posted November 2, 2020 Author Share Posted November 2, 2020 (edited) @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 July 28, 2021 by optimus1509 corrected for missing quote. Link to comment
alfred_jon Posted July 28, 2021 Share Posted July 28, 2021 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 Link to comment
deanishe Posted July 28, 2021 Share Posted July 28, 2021 3 hours ago, alfred_jon said: I couldn't get your command line to work above. The command isn't correct. There's a double quote missing at the beginning. Link to comment
optimus1509 Posted July 28, 2021 Author Share Posted July 28, 2021 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
deanishe Posted July 28, 2021 Share Posted July 28, 2021 (edited) 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 July 28, 2021 by deanishe Link to comment
optimus1509 Posted July 29, 2021 Author Share Posted July 29, 2021 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. deanishe 1 Link to comment
alfred_jon Posted July 29, 2021 Share Posted July 29, 2021 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
deanishe Posted July 29, 2021 Share Posted July 29, 2021 1 hour ago, alfred_jon said: I presume the result needs to be formatted into JSON? Yes. Link to comment
deanishe Posted July 29, 2021 Share Posted July 29, 2021 Here's a workflow that should show your Carbon Copy Cloner tasks in Alfred. It works with the sample input you gave me. luckman212 1 Link to comment
optimus1509 Posted July 29, 2021 Author Share Posted July 29, 2021 Awesome @deanishe. Thanks for your help. It works perfectly. Link to comment
alfred_jon Posted July 30, 2021 Share Posted July 30, 2021 @optimus1509 - is this working for you? Does it show you your tasks or does it launch them as well? On my laptop I get an option to show CCC tasks but hitting return on it shows me nothing. See screencast here; https://www.dropbox.com/s/wil95akb8r8js9q/ccc.mov?dl=0 Link to comment
deanishe Posted July 30, 2021 Share Posted July 30, 2021 5 hours ago, alfred_jon said: See screencast here I can't tell you anything from that video. Use Alfred's workflow debugger to see what's actually going on. Link to comment
optimus1509 Posted July 30, 2021 Author Share Posted July 30, 2021 @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
alfred_jon Posted August 1, 2021 Share Posted August 1, 2021 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
deanishe Posted August 1, 2021 Share Posted August 1, 2021 Oh right. I think you need to install the command-line developer tools. Try running /usr/bin/python3 or /usr/bin/git in Terminal.app. macOS should ask you if you’d like to install the devtools. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now