I have a small script that runs fine from the terminal but it doesn't seem to work when launched by the cron process.
I'm sure that cron is working because it updates my awstats periodically without problems.
This is my script:
/bin/ls -l /home/user/userdata/ | /usr/bin/cut -c30-35,49-100 | /bin/grep -e "[[:space:]]0[[:space:]]" | /usr/bin/mail firstname.lastname@example.org -s "Checkfiles" -b email@example.com -e
It emails the filenames that has no contents (file size = 0)
As you can see I added the full path to every command but it doesn't seem to work.
0 0,7 * * * /bin/sh /home/user/userdata/check_files.sh > /home/user/cronlog.txt
check_files.sh has permissions 777
Thanks in advance,