1
0
This repository has been archived on 2025-01-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Anderson Luiz Alves 0464e230c1 stock 103961
2017-07-30 16:48:04 -03:00

29 lines
502 B
Plaintext
Executable File

#!/bin/sh
# functions used to add or remove a dynamic task in the crontab
CRON_LIB=1
crontab_add() {
# $1 $2 $3 $4 $5 = timespec
# $6 = command
# $7 = name
local dir='/var/bewan/cron.d'
local spool='/var/spool/cron/crontabs'
mkdir -p $dir
mkdir -p $spool
echo "$1 $2 $3 $4 $5 $6" >$dir/$7
/etc/bewan/init.d/cron restart
}
crontab_remove() {
local name=$1
local dir='/var/bewan/cron.d'
if [ -f $dir/$name ]; then
rm $dir/$name
/etc/bewan/init.d/cron restart
fi
}