Problem executing commandline from script via cron
I am having trouble executing the iptables list commandline below within a script. When I execute the script within the /etc/SSH404Block/ folder as ./SSH404Block.sh, the iptables list is placed correctly into the temp2b.txt file. If I try to execute the SSH404Block.sh with the Cronjob line below, the iptables list is missing and the file will be empty.
Any clues as to how to fix this? Thanks.
iptables -L -n -v --line-numbers | sort -n -k9 > $filePath/temp2b.txt # get cur iptables
*/5 * * * * /etc/SSH404Block/SSH404Block.sh