Strictly speaking, the following can be interpreted to be contradictory goals.
- backup all files in the directory but not nested files i.e.
- backup certain directories - i.e. include some nested files
Please see below for an explanation on why your arguments did not work as you intended them. Further below, see a suitable alternative that might suit your purpose (it satisfies #1, #3 and a version of #2).
Why your command did not work:
The way rsync processes your commandline arguments, the following arguments are equivalent to saying --exclude='*/'
i.e., your command excluded all nested files, thus excluding files in desired subfolders as well.
This problem affects your second observation, namely that files in the target that are deleted in the source are not being deleted. Actually, your command works perfectly well in deleting such files at the top level. However, files one level below are not deleted since they are already excluded. It helps to remember that --delete refers to --delete-during, not --delete-before.
Solutions that satisfies #1, #3 and version of #2:
The following solution might suit your needs
rsync -avz --delete --include='includes/*' --include='js/*' --include='css/*' --exclude='*/*' /home/gameboy/abc/ /home/gameboy/PartialMirror/abc/
It satisfies the following:
1. Backs up all files and directories at depth 1, but not nested files.
2. Back up desired folders
3. Deletes files in destination that are not in source.
Another more cumbersome choice is as follows
rsync -vlptgoDd --delete src/ dest/
This satisfies #1 and #3, but avoids all nested files (remember that folders are also files in *nix). I avoided giving the -r option, so it is not recursive. Delete works and folders at depth 1 are copied. In addition to preserving timestamps (-t), I included the other typical options for archive copying.
A more standard way to get different rsync behaviors in different folders is to sprinkle filter rules in a per-directory fashion through the hierarchy; i.e. create .rsync-filter files specific to each folder that demands a unique behavior.
rsync -avF src/ dest/