add to "time"

- sleep a random duration
This commit is contained in:
bonnie 2020-02-15 23:53:37 +08:00
parent 4d017c2d4d
commit abed667be3

View File

@ -1076,6 +1076,9 @@ time echo hi
##### Wait for some time (e.g 10s) ##### Wait for some time (e.g 10s)
```bash ```bash
sleep 10 sleep 10
# wait for random duration (e.g. sleep 1-5 second, like adding a jitter)
sleep $[ ( $RANDOM % 5 ) + 1 ]
``` ```
##### Log out your account after a certain period of time (e.g 10 seconds) ##### Log out your account after a certain period of time (e.g 10 seconds)
@ -2779,11 +2782,6 @@ clear
# or simply Ctrl+l # or simply Ctrl+l
``` ```
##### Sleep awhile or wait for a moment or schedule a job
```bash
sleep 5;echo hi
```
##### Backup with rsync ##### Backup with rsync
```bash ```bash
rsync -av filename filename.bak rsync -av filename filename.bak