Skip to content

Instantly share code, notes, and snippets.

@Leask
Created January 10, 2020 22:35
Show Gist options
  • Save Leask/b7f89bc6bb89974a93e52ba15a04fdea to your computer and use it in GitHub Desktop.
Save Leask/b7f89bc6bb89974a93e52ba15a04fdea to your computer and use it in GitHub Desktop.
Clean Dropbox conflicted files.
#!/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