How to copy all your repositories without node_modules with rsync.

January 23, 2018 · 1 minute read

Sometimes when we are making backups on our files, and specially if you are a Node.js developer, you’ll suffer whilst copying your repositories to another place for making a backup. (Provided you don’t have git for all your repositories)

Just do:

 rsync -av --exclude 'node_modules' source destination

And you are set. You could also exclude some other things like adding adding gitignore rules

rsync -av --filter=":- .gitignore" source destination

Sign up for my mailing list, and get my blogs everytime I post