Reputation: 815
I have a cronjob set every 3 minutes to run a bash script. Now, I wish to separate the output and the errors to two separate files. I did read the answer given in this AskUbuntu question and tried */3 * * * * ./script.sh>>output.log 2>>errors.log
(>>
, since I'm creating the file in case it doesn't exist), but this seems to redirect the output again to errors.log
. What am I doing wrong?
Upvotes: 1
Views: 798
Reputation: 246578
That should work just fine.
Perhaps your problem is that you are not using absolute paths for the script and the log files?
Upvotes: 2