Ahh that worked. So it is the script but it does work manually? Here is the script:
It makes a copy of the current log and places it into a directory of /logs/Year/Month/CurrentDate.log
Could is be anything to do with it executing from the /etc directory when ran by crontab rather than the directory it is placed?
Code:
DYEAR=$(date +%Y)
mkdir logs/$DYEAR
DIR=$(date +%B)
mkdir logs/$DYEAR/$DIR
CURDATE=$(date +%d-%m-%Y)
cp server_log.txt.1 logs/$DYEAR/$DIR/$CURDATE.log
It makes a copy of the current log and places it into a directory of /logs/Year/Month/CurrentDate.log
Could is be anything to do with it executing from the /etc directory when ran by crontab rather than the directory it is placed?