iCloud Drive同步文件时,忽略指定目录

动机:

使用Gridea书写博客使用iCloud Drive进行目录同步,将数据目录设置到iCloud Drive下,但是并不想每次同步渲染结果的output目录。

解法

查询自 - 知乎 iCloud Drive同步文件时,如何忽略指定目录?

原文描述

# it is okay to delete the target folder since it will be rebuilt by maven
rm -r target
# create a nosync folder which will not be in iCloud
mkdir target.nosync
# create a symbolic link named "target" so that maven can find the target.nosync folder
ln -s `pwd`/target.nosync target
# rebuild the project
mvn package

实践

 ~/Library/Mobile Documents/com~apple~CloudDocs/Gridea : rm -rf output
 ~/Library/Mobile Documents/com~apple~CloudDocs/Gridea : mkdir output.nosync
 ~/Library/Mobile Documents/com~apple~CloudDocs/Gridea : ln -s output.nosync output