Created
January 10, 2020 22:35
-
-
Save Leask/b7f89bc6bb89974a93e52ba15a04fdea to your computer and use it in GitHub Desktop.
Clean Dropbox conflicted files.
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
#!/bin/sh | |
# Flora Dropbox clear by LeaskH.com | |
dbcMatcher="*(*'s conflicted copy 20*-*-*)*" | |
num=`find ~ -name "$dbcMatcher" | wc -l` | |
if [ $num -gt 0 ]; then | |
echo "Dropbox conflicted file(s):\n" | |
find ~ -name "$dbcMatcher" | |
echo "\nTotal: $num item(s), do you want to clear now? (y/n)" | |
read answer | |
if [ "$answer" = 'y' ]; then | |
find ~ -name "$dbcMatcher" -delete | |
echo "$num item(s) have been deleted" | |
fi | |
else | |
echo 'No Dropbox conflicted file' | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment