2

Can I set defaults for rsync in non daemon mode? I know the daemon mode has this configuration file: /etc/rsyncd.conf

But I typically use the non daemon version in this sort of manner:

rsync -avzcO --exclude-from=/path/to/rsync/exclude/list {from...} {to...}

Is there a way that I can set those flags to be defaults?

I'm using rsync version 2.6.9 protocol version 29 but I am happy to install a newer version if it has support for a default configuration file.

I suppose I could setup an alias but it just seems strange if there really is not a config file.

3
  • That's what putting a one line script in ~/bin/my_favorite_rsyncis quite good at. It may be less elegant than you'd like, but it certainly gets the job done with little fuss. – msw Sep 4 '13 at 18:02
  • although it won't work with bash tab completion (i.e. for completing remote paths) I don't think... – cwd Sep 4 '13 at 18:47
  • @cwd It can easily be made to work, by declaring the completion for my_favorite_rsync to be like for rsync. In zsh it would be compdef $_comps[rsync] my_favorite_rsync, I don't know the bash incantation. – Gilles 'SO- stop being evil' Sep 4 '13 at 23:00
0

Is there a way that I can set those flags to be defaults?

No, at least not with a config file. Use an alias for this.

I suppose I could setup an alias but it just seems strange if there really is not a config file.

I don't think it's strange. It's the same for tools like ls - if you want default options, you have to use an alias.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.