How to run sshpass crontab ?

Jbn1233
Mar 29, 2021

This is my first time facing this problem. My crontab didn’t run and got empty output.

Simple solution, just run it on screen.

0 * * * * cd /home/jbn1233/monitor ; screen -L -dm bash -c './chk_all.sh; exit'

This will create new screen, run command and then exit the screen.

“bash -c” for run multiple command in screen

“-L” for screen output log to file

Done.

refer: https://superuser.com/questions/454907

--

--

Jbn1233

Very short and simple notes for CKA/SRE and may not works on your environment | jbn1233@gmail.com | Bangkok, Thailand |