-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_dropbox_permissions.sh
More file actions
26 lines (21 loc) · 950 Bytes
/
fix_dropbox_permissions.sh
File metadata and controls
26 lines (21 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# By Ed Wiget
# This fixes dropbox sync issues on linux
mkdir -p $HOME/tmp
# get a list of files executable now
find ~/Dropbox -type f -perm -u+x > $HOME/tmp/dropbox_files-`date +%Y%m%d`
# fix the permissions
chown -R $USER ~/Dropbox
chmod -R u+rw ~/Dropbox
chown -R $USER ~/.dropbox
chmod -R u+rw ~/.dropbox
# remove any conflicting files from the file list above step 1
grep -v -e "conflicted copy" -e "Case Conflict" $HOME/tmp/dropbox_files-`date +%Y%m%d` > $HOME/tmp/dropbox_files-`date+%Y%m%d`.txt
# set the executable permissions back
for files in `echo $HOME/tmp/dropbox_files-\`date +%Y%m%d\`.txt` ; do chmod u+x "${files}" ; done
# remove any files that are in conflict
find ~/Dropbox -type f -name \*"conflicted copy"\* -exec rm -f "{}" \;
find ~/Dropbox -type f -name \*"Case Conflict"\* -exec rm -f "{}" \;
# remove temp files
rm -f $HOME/tmp/dropbox_files-`date +%Y%m%d`
rm -f $HOME/tmp/dropbox_files-`date +%Y%m%d`.txt