Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello,
I'm looking for a way to control selective sync programmatically? There's a certain folder I want to sync, for example, in certain hours of the day. With a cron job, I could instruct selective sync to include/exclude a folder.
Is this possible? Can you make it possible? 🙂
Thanks!
Yeah, this and several other requests are vital feature developments, but complex to integrate, requiring considerable effort.
Hmm, let's give it a little more time. To be reasonable, I'd say check back in about 15 years.
I'm sure by then they will be taken seriously and implemented. 🙂
Dropbox absolutely needs a better feature request system than "Post on a forum somewhere and we'll pass it on, we pinky swear".
You can ignore files and folders:
https://help.dropbox.com/files-folders/restore-delete/ignored-files
Set-Content -Path 'C:\Users\yourname\Dropbox(Personal)\YourFileName.pdf' -Stream com.dropbox.ignored -Value 1
Clear-Content -Path 'C:\Users\yourname\Dropbox(Personal)\YourFileName.pdf' -Stream com.dropbox.ignored
@hodaszayeah, that's not what we want, we want control of the selective sync feature. Ignored files are never synced to dropbox.
You are right, I'm sorry!
I found this forum because of b9chris's post about VS dev problems and didn't read the original question.
Ignoring bin, obj, etc... folders is a solution for b9chris's problem - it helped me for sure.
That worked!
I can't stand Powershell so here's some quick C# code that generates Powershell Dropbox ignore commands for every bin or obj folder in a root folder (since Visual Studio has a habit of throwing a ton of these all over a Solution/Project, and retyping all those paths is annoying).
public void MakePaths()
{
string rootPath = @"C:\Users\Chris\Dropbox\Code\2017\BrassNine";
var sb = new StringBuilder();
foreach(var path in problemFolders(rootPath))
{
sb.AppendLine($"Set-Content -Path '{path}' -Stream com.dropbox.ignored -Value 1");
}
string script = sb.ToString();
}
protected IEnumerable<string> problemFolders(string rootPath)
{
var dir = new DirectoryInfo(rootPath);
foreach (var badDir in dir.EnumerateDirectories("bin", SearchOption.AllDirectories))
yield return badDir.FullName;
foreach (var badDir in dir.EnumerateDirectories("obj", SearchOption.AllDirectories))
yield return badDir.FullName;
}
The script variable will be the Powershell lines to copy/paste into a Powershell window or .ps1 script.
I'm dumping mine into a root-level file named DropboxIgnores.ps1 so I can run it each time I restore to a new machine, since I don't think these ignores sync.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!