I made a script called
hello.sh and it contains the following:
#!/bin/bash printf "$( arp-scan --interface=eth0 --localnet )\n" printf "test\n"
after making it executable (
chmod o+x) and running it (
./hello.sh >> file.txt) I get the correct output in
file.txt (which is the arp-scan result and the string "test"). But after adding the following line to
*/1 * * * * /path/to/hello.sh >> /path/to/file.txt
I get the following output:
test test test
As you can see there is a empty string returned by the
arp-scan part. How can I get arpscan working with cron?
Additional info: Everything is done after logging in as sudo (
arp-scan needs sudo. I am running this on Fedora 20.