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
Open Synology Drive, go to
Settings
Under
Sync Tasks
, remember the task number of the task you want to ignore thenode_modules
folder, (eg. if it was the first task, then its task number is 1), and clickSync 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.
Click
File Filter
, and make surenode_modules
are not in there. Close the window, and quit Synology Drive.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.Go to
conf
, openblacklist.filter
using any text editor.Add a rule
black_name = "node_modules"
under[Directory]
, save and exit.Open Synology Drive, now it should stop syncing node_modules and you can find a red cross on the node_modules folder.
Reference
About this Post
This post is written by Andy, licensed under CC BY-NC 4.0.