Bash:
$ tree
└── orig
└── file
$ touch orig/file && rsync -ai --backup --backup-dir=orig~ orig backup
created directory backup
cd+++++++++ orig/
>f+++++++++ orig/file
$ tree
├── backup
│ └── orig
│ └── file
└── orig
└── file
$ touch orig/file && rsync -ai --backup --backup-dir=orig~ orig backup
>f..t...... orig/file
$ tree
├── backup
│ ├── orig
│ │ └── file
│ └── orig~
│ └── orig
│ └── file
└── orig
└── file
$ rm -rf backup && tree
└── orig
└── file
$ touch orig/file && rsync -ai --backup-dir=orig~ orig backup
created directory backup
cd+++++++++ orig/
>f+++++++++ orig/file
$ tree
├── backup
│ └── orig
│ └── file
└── orig
└── file
$ touch orig/file && rsync -ai --backup-dir=orig~ orig backup
>f..t...... orig/file
$ tree
├── backup
│ ├── orig
│ │ └── file
│ └── orig~
│ └── orig
│ └── file
└── orig
└── file
In summary, what is the difference between the following commands?
Code:
rsync -ai --backup --backup-dir=orig~ orig backup
rsync -ai --backup-dir=orig~ orig backup
they seem to do the same thing