mkdir new_directory && rsync -av --exclude=new_directory ./ ./new_directory/
Note: Next time, this command will only copy the changed files
rsync -avz /local/directory/ username@remote_server:/remote/directory/
or
rsync -avz source_user@source_server:/path/to/source_directory/ .
For example:
rsync -avz ubuntu@192.168.5.91:/home/ubuntu/new_directory .
- a: Archive mode, preserves permissions, ownership, and timestamps.
- v: Verbose output, shows details of the files being copied.
- z: Compresses data during transfer, reducing the network bandwidth required.