I read trough 20 questions regarding cron jobs and what not you need to set and I did all that, don't tag this as a duplicate. So my script is this:#!/bin/bashopenRTSP_process_ids=(`/bin/ps -fu $USER | /bin/grep openRTSP | /bin/grep -v grep | /bin/grep -v $0 | /usr/bin/awk '{print $2}'`)echo $openRTSP_process_idsfor i in ${openRTSP_process_ids[@]}do    if [ -n $i ]; then        echo $i        kill -1 $i    fidoneand my crontab looks like this:#SHELL=/bin/bashPATH=/home/username/bin:/home/username/.local/bin:/opt/OpenPrinting-Gutenprint/sbin:/opt/OpenPrinting-Gutenprint/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap$43,41,26,21,16,12,1,7,48,46,33,49,54,57,59,4,9,14,19,24,27,29,32,34,39,44 * * * * bash /home/username/Documents/stop_openRTSP &>> /home/username/stop.log50,55,0,5,10,15,20,25,30,35,40,45 * * * * /home/username/Documents/start_openRTSPI tried it with the standard sh shell and the bash shell both doesn't work. I tried redirecting the output to a log file bot using &>> bash redirection and 2>&1 sh redirection, but the log file is just empty. I tried a bunch of things but the proccess never get killed, but they do when I do it via command line.Additionally to adding path and shell I wrote all commands with their full path. I check if it worked by looking at ps aux | grep openRTPS and looking at the processes open. When I run the script from command line the processes get closed but via cron job they just stay open.In some versions I had a touch bla at the beginning so I do know that this specific scrip IS getting executed but not all commands.
Why does my cron job not work?
cron
If jobs or scripts are not doing what you expect them to, one very helpful troubleshooting tip is to add set -x to the top of the script, and inspect the output to ensure that the script is doing what you think it's doing.  It's quite possible you're making some assumptions or presumptions of your runtime environment which are not borne out in the field.