Loading...

Tech

How to exclude files from sync in Koofr

Are you syncing a lot of your files? Did you ever want to exclude certain files from being synchronised to your Koofr account or set some syncing rules? Maybe you want to exclude an entire filetype or only include another one? Read on and find out how you can simply do that with the help of our guide.

Are you syncing lots of files into your Koofr account? Do you sometimes want to exclude some of them from sync for whatever reason? You can simply do that with a .syncignore file you create in the root of your sync folder in the Koofr desktop app. Read on and find out more.

How does the .syncignore file work?

To be able to use the advanced exclusion (or inclusion) rules, you'll need to create a .syncignore file in the root of the folder that is being synced in the Koofr desktop app. In our case, we would put the .syncignore file into the JohnSuitcaseDesktop folder.

root_folder_syncignore.JPG

Note: You can create the .syncignore file by creating a new text file, deleting its extension and renaming it to .syncignore. The .syncignore file will not work if it has an extension, so be careful to remove it.

Note: The .syncignore file that is not at the root level of the folder that is being synced, will be ignored. If you have multiple synchronisations set-up, you will need a separate .syncignore file in each of the sync's root folders.

Important: It is smart to first create the .syncignore file inside the folder you wish to sync and then create the synchronisation to Koofr. Why? If you create a .syncignore file later and add it to an already existing sync, the files that were already synchronised will not be removed from the servers.

What to put into the .syncignore file?

Inside the .syncignore file, write one exclusion/inclusion rule per line using the glob format. Don't worry, we'll help you with some examples.

(1) If you want to ignore all .txt files, no matter where in the sync they are located, add this into the .syncignore file:

*.txt


Note: This will ignore all of the .txt files inside a specific sync, no matter where in the file structure they are located.

(2) If you want to ignore all .exe files in the /MyFiles folder inside your sync, add this into the .syncignore file:

MyFiles/*.exe


Note: This will ignore all .exe files inside the /MyFiles folder in your sync.

Note: In case you add a path pattern into the .syncignore file, for example: MyFiles/sample.exe, it is treated as a path, starting on top-level folder of the sync. It will only ignore MyFiles/sample.exe and not folders on a deeper level, like /samplefolder/MyFiles/sample.exe.

(3) If you want to ignore everything except .jpg files, add this into the .syncignore file:

*
!*.jpg


Note: This will ignore all of the other file types and sync only the .jpg files to Koofr.

(4) If you want to ignore all files inside IgnoreThis folder, no matter how deep in the structure this folder is located, add this into the .syncignore file:

IgnoreThis/


And if you want to ignore a folder on root level, add this into the syncignore file:

/IgnoreOnlyOnRoot/


(5) If you want to ignore the bar.rtf file inside the test folder on root of the sync, add this into the .syncignore file:

test/bar.rtf


Note: This is the same as if you would write /test/bar.rtf and it will ignore the bar.rtf file inside the test folder that is on root of your sync.

(6) If you want to make an exception and ignore all .txt files, with an exception of one, add this into the .syncignore file:

Do not ignore file on path /test/notignored_too.txt:

*.txt 
!test/notignored_too.txt


Note: This will ignore all .txt files except the file notignored_too.txt inside the test folder.

Do not ignore file named notignored.txt anywhere:

*.txt
!notignored.txt


Note: This will ignore all .txt files except the file notignored.txt wherever it is located.

pexels-christina-morillo-1181359.jpg

Read our previous blog post on this topic here.

Want to talk to us? Join us on the Koofr subreddit!

Enjoyed this article? Why not check out what we do.