Goal: Have crontab running at start up logging output from arp command in a txt file.> Chrontab:> > # daemon's notion of time and timezones.> #> # Output of the crontab jobs (including errors) is sent through> # email to the user the crontab file belongs to (unless redirected).> #> # For example, you can run a backup of all your user accounts> # at 5 a.m every week with:> # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/> #> # For more information see the manual pages of crontab(5) and cron(8)> #> # m h  dom mon dow   command* * * * * arp -n > results.txtUnfortunately, instead of writing the output of arp -n it overwrites results.txt with a blank file. The weird thing is if I use arp-n > results.txt in the terminal I get:GNU nano 2.2.6               File: results.txt                                                      Address                  HWtype  HWaddress           Flags Mask                Iface192.168.42.19                    (incomplete)                          wlan0192.168.42.14            ether   (incomplete)        C                 wlan0192.168.42.13                    (incomplete)                          wlan0192.168.42.18                    (incomplete)                          wlan0192.168.1.1              ether   (incomplete)        C                  eth0192.168.1.25             ether   (incomplete)        C                  eth0192.168.42.12            ether   (incomplete)        C                 wlan0192.168.1.240            ether   (incomplete)        C                  eth0192.168.42.11                    (incomplete)                          wlan0192.168.42.16                         M A                              wlan0Does anyone know how to fix this so I can get it running and updating the file using crontab?
Save arp output in terminal to text file every minute using crontab
cron
The problem seems to be that probably crontab does not know the PATH where the arp command lives.I would use:* * * * * /usr/sbin/arp -n >> results.txtHowever, I would use arpwatch to monitor ARP changes. It work as a daemon, and as it registers the MAC changes in a file over time, together with the epoch time of the change. It also is able to send messages to syslog and emails.From man arpwatchArpwatch keeps track for ethernet/ip address pairings. It syslogs  activity and reports certain changes via email. Arpwatch uses pcap(3)  to listen for arp packets on a local ethernet interface.Report MessagesHere's a quick list of the report messages generated by arpwatch(1)  (and arpsnmp(1)):new activity This ethernet/ip address pair has been used for the first  time six months or more.new station The ethernet address has not been seen before.flip flop The ethernet address has changed from the most recently seen  address to the second most recently seen address. (If either the old  or new ethernet address is a DECnet address and it is less than 24  hours, the email version of the report is suppressed.)changed ethernet address The host switched to a new ethernet address.Syslog MessagesHere are some of the syslog messages; note that messages that are  reported are also sysloged.ethernet broadcast The mac ethernet address of the host is a broadcast  address.ip broadcast The ip address of the host is a broadcast address.bogon The source ip address is not local to the local subnet.ethernet broadcast The source mac or arp ethernet address was all ones  or all zeros.ethernet mismatch The source mac ethernet address didn't match the  address inside the arp packet.reused old ethernet address The ethernet address has changed from the  most recently seen address to the third (or greater) least recently  seen address. (This is similar to a flip flop.)suppressed DECnet flip flop A flip flop report was suppressed  because one of the two addresses was a DECnet address.Files/var/lib/arpwatch - default directoryarp.dat - ethernet/ip address databaseethercodes.dat - vendor ethernet block list