find . -maxdepth 2 -mindepth 1 -type d | grep -e '\/.*\/.*' | cut -d\. -f2 | cut -d\/ -f2- | tee .rsyncignore
#cheatsheet #bash #rsync #exclude #cut
This will ignore everything at the depth of two. Run with
rsync --exclude-from=.rsyncignore -Pave 'ssh -p $remote_port' $remote_host:$remote_base_path .
BTW, no need for -mindepth 1 in `find` clause, oops.
Less wrong:
find . -maxdepth 2 | grep -e '\/.*\/.*' | cut -d\. -f2- | cut -d\/ -f2-
How I do it now:
find . -type f | grep -e '\/.*\/.*' | cut -d\. -f2- | cut -d\/ -f2- | tee -a .rsyncignore
Mastodon server of https://doma.dev.
This will ignore everything at the depth of two. Run with
rsync --exclude-from=.rsyncignore -Pave 'ssh -p $remote_port' $remote_host:$remote_base_path .
BTW, no need for -mindepth 1 in `find` clause, oops.