If you get a permission denied error when trying to redirect the output of a sudo command then the reason for this is normally because the superuser permissions only apply to the first part of the statement, e.g. the echo command. They do not carry through to the bash redirection.
paul@backups:~$ sudo echo 'test' >> /root/test
-bash: /root/test: Permission denied
One way to get round this is to use the tee command, as follows:
echo 'test' | sudo tee -a /root/test
Note that the -a switch means append to the file if it already exists.