automating nmap with crontab?
Hi, I've just installed nmap and I was wondering if I can set it up to scan my servers automatically and send me a report.I tried entering straight into crontab with no luck.
Code:
#crontab -e 20 14 * * * /usr/bin/nmap -v mydomain.net | mail -s "nmap output" root
So I thought maybe a script to call the nmap: runnmap.pl in /scripts:
Code:
#!/usr/bin/perl #script1 email nmap nmap -v mydomain.net | mail -s nmap root
What do you think would be the best approach, and have I done something wrong ? TIA