Although the stream is quite old, I found it on the same issue, and others will. Here is my solution for this problem:
You need comments, so if you look at your code much later, you will most likely get an idea of โโwhat you actually did when you wrote the code. I have the same problem when I write my first rsync script, which has many parameters that also have side effects.
Group together your parameter, which belongs together by topic and puts them in a variable that gets the corresponding name. This makes it easy to determine what parameter controls. This is your short comment. Alternatively, you can put a comment on the variable declaration to see how you can change the behavior. This is a comment on the long version.
Call the application with the appropriate parameter variables.
## Options # Remove --whole-file for delta transfer sync_filesystem=" --one-file-system \ --recursive \ --relative \ --whole-file \ " ; rsync \ ${sync_filesystem} \ ${way_more_to_come} \ "${SOURCE}" \ "${DESTIN}" \
Good review, easy to edit and remind comments in options. This requires a lot of effort, but therefore has a higher quality.
user2436486
source share