I am running a perl script via cron. I've got this line in the script:
`wget --no-cache --output-document=${dir}index.html localhost > /dev/null 2>&1`;
This works just fine. The contents of the file are saved to the disk.
But I cannot get seem to get this to work:
`wget -S --output-document=${dir}status.txt --spider -q -t 1 "example.com" > /dev/null 2>&1`;
The file is created, but it is empty. In trying other things, I discovered that this works from the command line:
wget -S --spider -q -t 1 "example.com" 1&>status.txt;
However, when I drop it into the perl file, the file is again empty. I'm not sure what is going on. The cron job is running as the same user I'm using on the command line.