I wrote a shell script with the following content:
#!/bin/bash
value=`cat test.txt`
echo "Output: $value" >> currentOutput.txt
By executing this script in shell, it writes correctly the value inside the currentOutput.txt. By executing this script over /etc/crontab, the file only gets filled with "Output:".
The executing user in shell and crontab is root. Also the owner from "currentOutput.txt", "test.txt" and the script is root. I'm just wondering about the different output between normal executing and executing by crontab.
This is my crontab entry:
*/5 * * * * root /bin/sh /var/www/testscript.sh
Any suggestions?