Skip to content

Instantly share code, notes, and snippets.

@janikvonrotz
Last active November 17, 2021 19:11
Show Gist options
  • Save janikvonrotz/21c05ba5808ca503e2eb9046a3795932 to your computer and use it in GitHub Desktop.
Save janikvonrotz/21c05ba5808ca503e2eb9046a3795932 to your computer and use it in GitHub Desktop.
Update Sync Exclude List for Nextcloud Client
#!/bin/sh
# origin: https://github.com/nextcloud/desktop/blob/master/sync-exclude.lst
if [ ! -f "~/.config/Nextcloud/sync-exclude.lst" ]; then
SYNC_EXCLUDE=~/.config/Nextcloud/sync-exclude.lst
fi
if [ ! -f "~/.var/app/com.nextcloud.desktopclient.nextcloud/config/Nextcloud/sync-exclude.lst" ]; then
SYNC_EXCLUDE=~/.var/app/com.nextcloud.desktopclient.nextcloud/config/Nextcloud/sync-exclude.lst
fi
echo "Updating nextcloud sync exclude list ..."
cat <<EOT > $SYNC_EXCLUDE
# This file contains fixed global exclude patterns
*~
~$*
.~lock.*
~*.tmp
]*.~*
]Icon\r*
].DS_Store
].ds_store
._*
]Thumbs.db
]photothumb.db
System Volume Information
.*.sw?
.*.*sw?
].TemporaryItems
].Trashes
].DocumentRevisions-V100
].Trash-*
.fseventd
.apdisk
.Spotlight-V100
.directory
*.part
*.filepart
*.crdownload
*.kate-swp
*.gnucash.tmp-*
.synkron.*
.sync.ffs_db
.symform
.symform-store
.fuse_hidden*
*.unison
.nfs*
My Saved Places.
\#*#
.git
default.vim
node_modules
.now
.vercel
.trash
.gitignore
.gitmodules
workspace
EOT
echo "Updated file: $SYNC_EXCLUDE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment