https://github.com/jnidzwetzki/sleepuntil
A program that sleeps until a certain time is reached
https://github.com/jnidzwetzki/sleepuntil
commandline-tool devops sleep
Last synced: 12 months ago
JSON representation
A program that sleeps until a certain time is reached
- Host: GitHub
- URL: https://github.com/jnidzwetzki/sleepuntil
- Owner: jnidzwetzki
- License: apache-2.0
- Created: 2018-04-19T14:49:06.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-11T08:42:26.000Z (about 8 years ago)
- Last Synced: 2025-02-26T15:14:44.736Z (over 1 year ago)
- Topics: commandline-tool, devops, sleep
- Language: Go
- Size: 417 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sleepuntil

This program acts as the famous ``sleep`` unix command. The main difference is, that ``sleepuntil`` sleeps until a certain time is reached. ``sleep`` in contrast sleeps a fixed amount of seconds.
``sleepuntil`` was written to take over simple jobs in maintenance work (e.g., shutdown the mysql server at 06:00 am).
## Usage
```bash
$ ./sleepuntil -help
Usage: sleepuntil
-help
Show help.
-progress
Show a progress animation for the remaining time.
-verbose
Be verbose.
Version: 0.1
Please report bugs here: https://github.com/jnidzwetzki/sleepuntil/issues
```
## Examples
__Note:__ You should use the ``&&`` operator to schedule commands. In contrast to ``;``, the next command is only executed if the execution of the previous command (``sleepuntil``) was successful. The ``;`` operator executes the next command in any case. When a wrong date format was specified (or a date in the past) the execution of ``sleepuntil`` fails. When ``;`` is used, the next command is executed immediately, when ``&&`` is used, the next command is not executed.
```bash
# Sleep until 04:00 and shutdown the MySQL server afterwards
sleepuntil 04:00 && service mysql stop
# Sleep until 2019-01-02 15:04:05, show the remaining time and restart the apcahe webserver afterwards
sleepuntil 2019-01-02 15:04:05 -progress && service apache2 restart
|****--------------------------------------------------------------------------------------------|
```
## License
This project is licensed under the Apache 2.0 license. See the [LICENSE](./LICENSE) file for details.