I have the following bash script:
#!/bin/bash
src="/home/user/testingscript"
for dir in $(ls "$src")
do
find ${src}/${dir}/ -type f -mtime +31 delete
done
It runs fine if i execute it from the terminal, but once i put it in the crontab like that:
* * * * * /bin/bash /home/user/script/mailboxclean.sh >> /home/user/mailboxcleanup.log 2>&1
or as:
* * * * * /home/user/script/mailboxclean.sh
it doesnt run.
I see no feedback in the syslog, apart that the script has been executed and in the mailboxcleanup.log where i am redirecting I see the followinh which doesnt really help:
/home/user/mailboxcleanup.log: 1: /home/user/mailboxcleanup.log: /bin/sh:: not found
Any ideas?
Thanks