Last active
December 27, 2018 19:03
-
-
Save matthewcosgrove/7a98cc996f8d7e421dd392c8d736b5eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
df -hT | |
sudo debugfs -R features /dev/xvda1 | |
cat /etc/fstab | |
echo "Checking pre-requisites..." | |
sudo apt-get -qq update | |
sudo apt -yqq install python | |
pushd ~ > /dev/null | |
[ ! -e ~/.dropbox-dist ] && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf - | |
dropbox_cli=/usr/local/bin/dropbox.py | |
[ ! -e $dropbox_cli ] && sudo wget -O $dropbox_cli "https://www.dropbox.com/download?dl=packages/dropbox.py" | |
sudo chmod +x $dropbox_cli | |
echo "alias dropbox=/usr/local/bin/dropbox.py" > .bash_aliases | |
echo Success!! | |
wget -O dropbox_cli_selective_sync.sh https://gist.githubusercontent.com/matthewcosgrove/48c4c4aaab0f171fae30a47c1694460b/raw/51e52177b44ee0f163fb752139b7eeb58c77747d/dropbox_cli_selective_sync.sh | |
sudo chmod u+x dropbox_cli_selective_sync.sh | |
popd > /dev/null | |
# The following didnt work for me so was repeating 'dropbox exclude add "$(ls | grep -v CapoeiraSubsonicLibrary | head -1)"' | |
# One way I have found to make this work is to execute the command while being in the Dropbox folder e.g: (pretty certain this is same as specifying the absolute path) | |
# src: https://serverfault.com/a/284242 | |
# TODO: Exclusions need to be dynamically handled. WARNING: New folders added/renamed in the root will likely fill the disk!! | |
echo "To complete the set up first run '. .bash_aliases'" | |
echo "then 'dropbox status && ~/.dropbox-dist/dropboxd' and follow the instructions" | |
echo "WARNING: Starting dropbox in the next step will start downloading everything from your account, so should be followed up with the dropbox_cli_selective_sync.sh ASAP" | |
echo "then continue with 'dropbox start && dropbox lansync n'" | |
echo "Purge regularly with DROPBOX_FOLDER_TO_KEEP=CapoeiraSubsonicLibrary ./dropbox_cli_selective_sync.sh" | |
echo "RECOMMENDED: Run the following command and patiently watch the output until you are happy all the intended excluded directories are truly excluded" | |
echo "watch DROPBOX_FOLDER_TO_KEEP=CapoeiraSubsonicLibrary ./dropbox_cli_selective_sync.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment