cron problems

jaja55

New Member
Jun 15, 2023
29
1
3
Hi,
my UPS disconnects after a view hours. I found a solution by executing the following script:
Code:
upsdrvctl stop
wait 10
upsdrvctl start

now I try to use crontb to start it automaticly.
I use:
Code:
0 8,20 * * * root /scripts/restart.usv.sh daily

but it doesent work.
what is wrong ?
Thx for help
 
Maybe you want to use sleep instead of wait? Maybe your script file is not executable or it does not start with #!/bin/sh?
Why not use (in cron): 0 8,20 * * * upsdrvctl stop; sleep 10s; upsdrvctl start? Maybe you need to use the full path to upsdrvctl (use which upsdrvctl to find it).