cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Checking in and out / pause sync on folder

Checking in and out / pause sync on folder

projectdeliverypartners
Explorer | Level 3

Hi All,

 

I'm new to app development and to this forum and I feel my question is so basic it must have been asked and solved before however, I cannot seem to find anything similar within the existing threads.

 

I'm a civil designer and run my projects in various folders live on dropbox, windows 10. This works extremely well for almost everything I do except for one program which utilises databases in it's back end. I suspect some files are dependant on others and the like, changes in the model are updated in strings which may (I suspect) not be big enough for DB to notice the difference in size and therefore mark to upload. Believe me, I’ve tried and working with this program in a live dropbox folder is not a good idea. Best way for me to get around that currently is to pause syncing, do what I need, save and close the program then turn syncing back on. This generally works however, still seems to have some issues.

 

I would like to develop an app where I can select a folder to 'check out', do any editing I need, save and close, then the entire contents of that folder is uploaded to dropbox again. It may be checked out or perhaps syncing paused on just that folder, I’m not sure how best to achieve it yet but that’s the idea.

 

Surely something like this already exists? Any help / point in the right direction would be much appreciated.

 

-Jake

4 Replies 4

Здравко
Legendary | Level 20

Hi @projectdeliverypartners,

I see what you want to achieve, but activities exactly what you want are not supported. While on Linux it's relatively simple to do something alike (pause and resume, after you have done) using shell script, on Windows it isn't so trivial. In all cases you can upload all target files independently of official Dropbox application. Just create your own upload script and do it. Similar Python example, you can start from (use as a template), can be seen here. 😉 You can realize the same on any programing language.

Good luck.

projectdeliverypartners
Explorer | Level 3

Thank you @Здравко,

If i read behind the lines here, it's not supported but perhaps it can be done? I have thought of doing it outside of dropbox via basic shell script, most probably python yes. It's more complicated than uploading but surely not very hard. It would have to be something like this:

- Copy project folder from dropbox to local drive folder

- Confirm copy complete, delete contents of dropbox project folder.

- Create some kind of trigger upon close of local drive project from the app and form message, 'Upload project to Dropbox?"

- Hit yes and if so, it uploads accordingly, and deletes the copy in the local drive folder.

 

I would very much like to avoid copying whole project folder location if i can. A better way to me would be to:

- pause syncing as i do manually only limit to a particular folder or (with firewall?),

- once project has been edited and closed down, maybe rename the project folder on dropbox to *.upload, create new project folder with previous name and copy entire contents into it. This way the root folder would have been created at a new time and have brand new metadata so dropbox will surely upload the entire contents as new.

 

What do you think?

 

 

Здравко
Legendary | Level 20

@projectdeliverypartners wrote:

...

I would very much like to avoid copying whole project folder location if i can. ...


Hi again @projectdeliverypartners,

To be honest I have no idea why you need this copy, delete, etc. 🤔 Isn't keeping the files on single place doesn't work for you? (Let's say keep them outside
the Dropbox folder and opt out the same folder in Selective Sync on Dropbox application, for instance)

 


@projectdeliverypartners wrote:

... A better way to me would be to:

- pause syncing as i do manually only limit to a particular folder or (with firewall?),

...


As I said, if you work on Linux, that would be very simple way:

#!/usr/bin/bash
dropbox stop
#
# do something on your project here
#
dropbox start

 Unfortunately, inapplicable on Windows and Mac. Dropbox application there doesn't come with CLI. 🤷 Using firewall or other similar workarounds would not work!

It's good idea to check why a changed file stays with the same timestamp, if there is such. 😉 This gonna give you direction.

 

PS: One more detail, you may be useful to know, is fact that metadata itself alone are never updated by Dropbox! In other words metadata gets, eventually, changed when least one byte in the file data is different. If you update some file (text or binary) to exactly the same content, local timestamp will change, but cloud timestamp wont! Such files aren't considered changed; keep this in mind.

Greg-DB
Dropbox Staff

@projectdeliverypartners As Здравко noted, unfortunately Dropbox does not offer an API or way to programmatically manage the official Dropbox desktop client, such as to pause or resume syncing, except that the Dropbox desktop client on Linux only does support some command line commands. I'll pass this along as a feature request, but I can't promise if or when that might be implemented.

 

 

Need more support?