rsync deployment - the best way of excluding .DS_Store files?

104 views
Skip to first unread message

Dave Everitt

unread,
Jun 13, 2022, 1:03:42 PM6/13/22
to nanoc
I maintain one old Nanoc site that uses rsync (on more recent sites I've set up deploy to use Git and SSH instead). On OS X Monterey (and, I think earlier) OS X security measures cause rsync to fail. I used Homebrew to install an rsync that (pathetic but accurate description) "can access all my files" and it works.

One rsync issue (in case anyone else had the issue) is new files sometimes have restrictive permissions (e.g. images someone sends for a website update) so need `chmod 644`.

However, my current rsync issue is that `nanoc deploy` with rsync, copies all the .DS_Store files to the server.

I can't add the necessary `rsync -r --exclude=".DS_Store" to the Rules, so where could I add that command or something else to do the job in the Nanoc deploy chain?

Eric Sunshine

unread,
Jun 13, 2022, 4:31:22 PM6/13/22
to na...@googlegroups.com
On Mon, Jun 13, 2022 at 1:03 PM Dave Everitt <dever...@gmail.com> wrote:
> However, my current rsync issue is that `nanoc deploy` with rsync, copies all the .DS_Store files to the server.
>
> I can't add the necessary `rsync -r --exclude=".DS_Store" to the Rules, so where could I add that command or something else to do the job in the Nanoc deploy chain?

nanoc documentation[1] gives an example of how to pass extra options
to `rsync`; for instance:

deploy:
default:
kind: rsync
dst: myhost:/var/www/mysite
options: [ '-aP', '--delete-after' ]

You should be able to add `--exclude`, as well.

[1]: https://nanoc.app/doc/deploying/#with-rsync

Dave Everitt

unread,
Jun 15, 2022, 5:51:47 AM6/15/22
to nanoc
thanks Eric - searched but couldn't find in the docs (brain not functioning within normal parameters!) - a capital '-R' also removed the .DS_Store at the site root.
Reply all
Reply to author
Forward
0 new messages