UNPKG
@porosys/ndtool
Version:
latest (0.0.51)
0.0.51
0.0.50
0.0.49
0.0.48
0.0.47
0.0.46
0.0.45
0.0.44
0.0.43
0.0.42
0.0.41
0.0.40
0.0.39
0.0.38
0.0.37
0.0.36
0.0.35
0.0.34
0.0.33
0.0.32
0.0.31
0.0.30
Netdata alert and automation tool
@porosys/ndtool
/
lib
/
utils
/
is-cron-job-present.util.ts
10 lines
(9 loc)
•
278 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
import
{ execa }
from
'execa'
;
export
const
isCronJobPresent =
async
(
scriptPath
:
string
):
Promise
<
boolean
> => {
try
{
const
{ stdout } =
await
execa
(
'crontab -l 2>/dev/null'
, {
shell
:
true
});
return
stdout.
includes
(scriptPath); }
catch
{
return
false
; } };