1. Add the option "--exclude=PATTERN" in rsync, don't sync some file.
2. Store the command line in the $cmd, call ($cmd) to run the command line.