I have a bash script with the following command
command1 < input.txt > output.txt
When I run it, the output.txt file is created and filled with almost 5mb of data. The problem is that when its it's run by cron it doesn't work. It creates the file output.txt but it's empty. I believe that what's happening is that it's not reading the input from input.txt so command1 exits right away, creating the output file but don't printing anything.
Anyone knows what is happening and how can it be fixed?
EDIT: After trying a lot of options it appears that the problem is that the cron is configured to redirect stdin, so no matter if I redirect stdin or if I pipe processes, nothing is able to read anything from stdin. ¿Any solution?