I want to copy current directory to my backup directory:
I tried this command rsync -a . ~/backup/
but it just copies the current directory contents instead of creating new directory at the destination.
I know creating new directory at the destination end can be achieved by avoiding the trailing slash in source path. But it does not work in my case since I am using a period(".") instead of directory name.
I want rsync to create a new directory at the destination path with name same as the current directory. How can I achieve this?