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,035
  • 11
  • 19
user79067
  • 33
  • 3
  • 1
    The duplicate will help you solve your problem. If it does not, it will help you gather information that will help us help you. You should edit that information into your question. – user9517 Nov 13 '15 at 14:24
  • Sorry, I checked everything except the file location for complete path. You were right on and adding the full path for all files fixed it. – user79067 Nov 19 '15 at 00:02

0 Answers0