We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
Jeff_S1
4 years agoExplorer | Level 3
sync only one folder on linux
I have a huge dropbox business account, and I'd like to sync one "deep" folder on a linux client. This folder is deep in the folder hierarchy, so for example the folder: "folder 1/folder 2/folder 3"...
Здравко
Legendary | Level 20
Hi Jeff_S1,
Seems, you are thinking in exactly opposite way instead of what "Selective Sync" implementation assumes to. 🙂 As seems you have noticed (to some extent) that using command (or GUI) folder tend to be excluded, not included, so how exactly you can add a subfolder in a missing (excluded) folder?! 🧐 Try to do the same trick using GUI (not necessary on Linux). Do you able? 🙄 What's the problem? 😉 Using the command prompt is the same! Execute on command line the equivalent things you are doing on GUI. Unchecking particular folder means adding to "exclude list" and checking the same folder means removing from "exclude list". Take in mind that in GUI when you set check mark to a nested folder all containing folders receive check mark too. In console you have to do this by hand! This is NOT done by the control script for you! This could be object of improvements (not to say it's a bug). When adding folders you have to add nested folders from outermost to innermost folder... Or better opposite, instead of exclude all and after that to try add some of them, just exclude folders you don't want to be in sync locally. Nothing special, the same commands (even one less) in right order. 😉
Hope this gives right direction.
Jeff_S1
4 years agoExplorer | Level 3
Ahh, OK. This makes sense. So, I need to include folder 1. Then exclude all children of folder 1. Something like:
dropbox.py exclude remove ~/Dropbox/folder 1
dropbox.py exclude add ~/Dropbox/folder 1/*
dropbox.py exclude remove ~/Dropbox/folder 1/folder 2
dropbox.py exclude add ~/Dropbox/folder 1/folder 2/*
dropbox.py exclude remove ~/Dropbox/folder 1/folder 2/folder 3
I'll give that a try...
- jamespi4 years agoHelpful | Level 5
Did you get this to work? I have a problem where I can't sync the single folder I want, because despite excluding all the other folders, dropbox still wants to download all of them first before then deleting the excluded ones. This doesn't work because my hard drive is not big enough to sync the entire dropbox folder.
I can't find a way to set up the exclude list in advance before syncing, and having it not even attempt to download the excluded folders. You mention having a 10TB dropbox, so I imagine this is a problem you would run into as well, unless I'm just being dumb somehow.- Jay4 years agoDropbox StaffHi jamespi, thanks for your message. I'd recommend contacting the support team to look into this matter in more detail.
- Concerned Citizen3 years agoHelpful | Level 6
I would suggest this is a common use case and should be treated as a mainstream use of the product. I'm setting up a Minecraft server on Digital Ocean and just assumed it'd be easy to use Dropbox in this fashion. All I wanted to do was basically sync a directory like Games/Minecraft to this droplet, without having to first sync the entire service (which is prohibitively large for this VM). We need an --exclude * and then --include foo type of mechanism.
- Robert T.262 years agoExplorer | Level 4
i just happened to find this old bash script i wrote under ~/Dropbox/.dropbox.cache/old_files/
Because it was found under /old_files/, it is probably not the best version, so use at your own risk! Since it does not delete files, only does dropbox exclude operations, it might be safe. This was written maybe a decade ago.
Looks like it would give an error because a folder does not exist in the readlink call. mkdir -p ${T} before looping might be necessary.
The intent is to automate adding a parent folder of the deeply nested targeted folder folder you want to download.
While excluding all other folders brought in when a parent folder is added.
I should have a newer version in my old bitbucket files or github or sf, but will take a while to find it.
#!/bin/bash echo Problems: echo dropbox exclude remove ~/Dropbox/DontExcludeMe/MeNeither echo does nothing unless its parent directory is first included first. echo When the parent directory is included, it brings in all its subfolders and files. echo I smell a tree walk of some kind here. echo Is bash capable of binary trees? echo Would have to include all the ancestors that do not exist yet echo and then add the child directories one-at-a-time echo but at the same time, exclude any other directories. D=~/Dropbox T=~/Dropbox/DontExcludeMe/MeNeither # T for TARGET #mkdir -p ${T} # May need to uncomment this to precreate the wanted nested folder. T2=${T}; dropbox exclude remove ${T} #WONT DO ANYTHING IF PARENT DOES NOT EXIST. echo ${T2}; while [ ${D} != ${T2} ]; do J=$(dirname $(readlink -f ${T2} )); #readlink CAUSES FAILURE WHEN $T DOES NOT EXIST echo readlink CAUSES FAILURE WHEN ${T2} DOES NOT EXIST. Add code to test for existance of ${T2}. echo ${J}; echo "We have to filter for the directory target ${T2}, otherwise we add it right back to be excluded!" dropbox exclude remove ${T2} sync #Give it a little time to come back. Should loop for it to be back in existence. find ${T2} -maxdepth 1 -type d -print0 | egrep -v "^${T2}$" | xargs -0 dropbox exclude add T2=$J; done; #find ${T} -maxdepth 1 -type d -print0 | egrep -v "^${T}$" | xargs -0 dropbox exclude add
- Robert T.262 years agoExplorer | Level 4
Nothing new, but SSDs smaller than Dropbox storage.
Because the filesystem is out of space, i excluded a large number of files from syncing locally to dropbox usingdropbox exclude add ~/Dropbo/ExcludeThisLargeFolder/
But dropbox does not free up that space first, it continues to attempt to download more files even though it knows it is out of space.
Does not matter if i 'Pause Syncing' or limit the download bandwidth to about zero.
Need exclude to go first.
Not sure if the Delete operation talked about above applies to files and folders you do NOT want deleted from Dropbox.com storage. - Здравко2 years agoLegendary | Level 20
Hi Robert T.26,
There are some missing features in Dropbox for Linux and there is no way this BUG to be compensated. For simplifying exclusion of everything else (as much as possible), but a desired folder, you can use following script:
#!/bin/bash ############################################################################## # Minimize local folders in sync # ------------------------------ # Evaluation is performed based on passed folder that has to stay local. # Other files/folders get keep if/when needed only. # Verified on Dropbox v170.4.5895 # Just make it executable (if need, using # $ chmod a+x stayAloneInDropbox # ) and run it. # Author: Здравко # www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790 ############################################################################## # General command line check. errorMesage() { echo "Command line should be 'stayAloneInDropbox <folder in Dropbox>'" echo " where <folder in Dropbox> should be a folder you want to stay in" echo " local Dropbox folder as is comletely, but everything else limited" echo " as much as possible." echo echo "$@" exit 1 } if [ $# -ne 1 ] then errorMesage "Expected arguments count 1, provided $# -> $@" fi target_folder=`realpath "$1"` EOL=$'\n' ############################################################################## # Command argument validation. if [ ! -d "$target_folder" ] then errorMesage "😯 The argument ($1) does NOT point a folder." fi ############################################################################## # Figuring out local Dropbox folder location. dbx_dir=`jq -r .personal.path ~/.dropbox/info.json` if [ $? -ne 0 ] then echo "Cannot detect Dropbox application installed and worked local." exit 1 fi if [ ! -d "$dbx_dir" ] then echo "Incorrect Dropbox folder path ($dbx_dir)!" echo "Only individual Dropbox account is supported." exit 1 fi ############################################################################## # Dropbox folder validation. if [[ "${target_folder:0:${#dbx_dir}}" != "$dbx_dir" ]] then errorMesage "🤦 The pointed folder ($1) does NOT reside within your${EOL}\ Dropbox folder ($dbx_dir)." fi if [[ "$target_folder" == "$dbx_dir" ]] then errorMesage "Nothing to do. Dropbox folder itself is always there!${EOL}\ Point some subfolder there." fi ############################################################################## # Process nested folders. while [[ "$target_folder" != "$dbx_dir" ]] do parent_folder=`dirname "$target_folder"` template=`basename "$target_folder"` echo echo "Keep only subfolder '$template' and remove all others" echo "in the folder '$parent_folder'..." template="/$template" if [[ "$parent_folder" == "$dbx_dir" ]] then template="${template}|/.dropbox.cache" fi find "$parent_folder" -mindepth 1 -maxdepth 1 -type d -print0 | \ egrep -z -v "($template)\$" | xargs -0 dropbox exclude add target_folder="$parent_folder" done echo echo "Complete! 😉" echo
Take in mind that it wont fix any existing issue, but just simplifying the exclusion process. 🤷 Bugs can be fixed by Dropbox developers only.
Hope this helps to some extent. 😉
About View, download, and export
Need support with viewing, downloading, and exporting files and folders from your Dropbox account? Find help from the Dropbox Community.
Need more support
If you need more help you can view your support options (expected response time for an email or 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!