We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Tom_M
12 years agoHelpful | Level 6
Status:
In Beta
Add .dropboxignore directory to exclude folders without using selective sync
Please please please can you add a feature that allows folders to be excluded from the Dropbox account (on windows and mac). For sure I'm not the first person to request this, but I'm yet to find a g...
Lars P.3
6 years agoHelpful | Level 6
I creates this powershell scripts that reads a .dropboxignore file and set all the folders recursively to be ignored.
# https://help.dropbox.com/en-us/files-folders/restore-delete/ignored-files
$ignoreList = Get-Content .dropboxignore
$folderList = Get-ChildItem -Path . -Recurse -Directory -Force -ErrorAction SilentlyContinue | Select-Object FullName
$baseList=@()
"Ignoring the following folders:"
$ignoreList
""
foreach ($folder in $folderList)
{
foreach ($ignore in $ignoreList)
{
$ignore = $ignore.Trim()
$index = $folder.FullName.IndexOf($ignore)
if ($index -ge 0 )
{
$base = $folder.FullName.SubString(0, $index+$ignore.Length)
if ( ! $baseList.Contains($base))
{
$base
Set-Content -Path "$base" -Stream com.dropbox.ignored -Value 1
$baseList = $baseList + $base
}
break
}
}
}
""
"Folders ignored:"
$baseList
# Clear-Content -Path 'C:\Users\yourname\Dropbox\ (Personal)/YourFileName.pdf' -Stream com.dropbox.ignored
# Set-Content -Path C:\Users\lars\Dropbox\RaiseYourFinger\node_modules -Stream com.dropbox.ignored -Value 1
It's not perfect, but it suits my needs.
Related Content
- 7 years ago
- 7 years ago
- 4 years ago
- 6 years ago
- 6 years ago