0

I have a script which is being run via crontab. It seems to not be running the NMAP portion.

#!/bin/bash
DATE=$(date +%Y%m%d_%H%M)_MVT_INT_DEV
nmap -p0 -oG /home/tyler/NMAP/$DATE.gnmap -iL ip-list.txt
awk -F" " -v date="$(date)" '{print "\"" $2 "\",\"" $3 "\",\"" date"\""  }' /home/tyler/NMAP/$DATE.gnmap > /home/tyler/NMAP/$DATE.txt

The last output file gets created but the first .gnmap file does not.

I'm sure that its something i screwed up. The script runs great on its own but not via cron.

Nov 13 07:00:01 kali /USR/SBIN/CRON[4405]: (root) CMD (/home/tyler/NMAP/mvt-int-devices.sh)
Nov 13 07:00:01 kali /USR/SBIN/CRON[4404]: (CRON) info (No MTA installed, discarding output)
dr_
  • 1,135

0 Answers0