October 21, 2024

Synology Drive ignore folders like node_modules while syncing

While I was trying to sync my local repository using Synology Drive across several devices, I found it was low efficiency and time waste to sync the node_moudles folder in each project. Unfortunately, Synology Drive GUI does not support ignoring folders in Settings unless you manually uncheck those folders you do not want to sync which is impossible for me cause there are over 50 projects in my local repository, I can’t open each project and uncheck each node_modules folder in each project, that is way to time waste.



Steps

  1. Open Synology Drive, go to Settings

  2. Under Sync Tasks, remember the task number of the task you want to ignore the node_modules folder, (eg. if it was the first task, then its task number is 1), and click Sync Rules.

    The task number may vary, if you have several sync tasks, you need to identify which task number you want to ignore the node_modules.

    One easier way is in the File Filter, adding a unique filter rule so you can identify the task easily. For example, add a filter rule called “.andyzzz”. After you identify the task number, you can undo this step.

  3. Click File Filter, and make sure node_modules are not in there. Close the window, and quit Synology Drive.

    image-20241021141646725

  4. On Mac, go to /Users/Your_Username/Library/Application Support/SynologyDrive/data/session, and choose the folder number equal to your task number (eg. folder 2).

    On Windows, the path is C:\Users\Your_Username\AppData\Local\SynologyDrive\data\session.

    Replace Your_Username with the actual username used to log into your system.

    image-20241021134748047

  5. Go to conf, open blacklist.filter using any text editor.

  6. Add a rule black_name = "node_modules" under [Directory], save and exit.

    image-20241021141816990

  7. Open Synology Drive, now it should stop syncing node_modules and you can find a red cross on the node_modules folder.

    截屏2024-10-21 下午2.20.23



Reference

About this Post

This post is written by Andy, licensed under CC BY-NC 4.0.

#Synology#SynologyDrive#node_modules