https://github.com/tbarbette/limitrate
Limit the rate of running a command by batching one parameter according to specified rate
https://github.com/tbarbette/limitrate
Last synced: about 2 months ago
JSON representation
Limit the rate of running a command by batching one parameter according to specified rate
- Host: GitHub
- URL: https://github.com/tbarbette/limitrate
- Owner: tbarbette
- Created: 2014-10-29T14:22:28.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-06T08:46:56.000Z (over 9 years ago)
- Last Synced: 2025-02-14T05:29:45.644Z (3 months ago)
- Language: Shell
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Limit rate
This programs allows you to limit the rate of launching a certain command. Instead of launching
> /usr/bin/program argument1 argument2
call :
> limitrate 30 "/usr/bin/program % argument2" argument1
To launch only this command at maximum once every 30 seconds. If you call multiple times the last line in 30 seconds, limitrate will concatenate all "argument1" and run the command after 30 seconds. For example to send an alert e-mail containing files (for example webcam picture) at max every 30 seconds :
```
10:24:30 : limitrate 30 "echo \"Alert!\" | mailx % [email protected]" "-A /path/to/file1"
--> Send a mail with file1
10:24:32 : limitrate 30 "echo \"Alert!\" | mailx % [email protected]" "-A /path/to/file2"
10:24:38 : limitrate 30 "echo \"Alert!\" | mailx % [email protected]" "-A /path/to/file3"
10:24:41 : limitrate 30 "echo \"Alert!\" | mailx % [email protected]" "-A /path/to/file4"
10:25:05 : limitrate 30 "echo \"Alert!\" | mailx % [email protected]" "-A /path/to/file5"
--> Send a mail with file 2,3,4 and 5
```Example for motion detection daemon (Camera surveillance) :
> on_picture_save /usr/local/bin/limitrate 15 "echo \"See attachment below.\" | mailx -s 'Motion in the saloon !' % [email protected]" "-A %f"
When an intrusioon is detected, you'll receive a first e-mail with one image. 15 seconds later you'll receive all the new images in only one mail, and so on.