Pausing The Sync Of A Folder When An Application Is Running


carl566

Recommended Posts

Ok so I have a fairly basic problem I want to solve, I want to pause a specific folder when I'm running a specific application on my Mac.

 

I was hoping to create a simple lightweight shell script that I could schedule every 15-30 minutes (the pause / resume does not have to be instant), which checks for the running application, if it see's it and the folder is set to sync then it hits the API and pauses it. Simple, and then does the reverse if it doesn't see the application running and the folder is paused.

 

It's only for personal use, I'm a developer myself so can normally knock together things like this. But I did have a couple of quick questions:

 

1. First is this API suitable for this and can pause/unpause a folder on my mac?

2. Does the above basic idea sound feasible

3. Will I have to pay to use this API even though it's such a basic requirement and non commercial?

 

Thanks!

Link to comment
Share on other sites

@mrcarl79

Yes, you can do it with API. Please see this API doc, you are especially interested in "/folders/{fid}" PATCH method. You need to alter "stopped" param to stop sync completely, or "paused" to stop delivering of files and keep syncing service data (i.e. keep files being monitored).

 

Not sure about #3 - we have only one API usage plan, and it is subscription based. I'll check it and get back to you.


@mrcarl79

As you are not using any PRO functionality, you can request and use dev key.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.