LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Sudo Aureport Redirect output (https://www.linuxquestions.org/questions/linux-newbie-8/sudo-aureport-redirect-output-824647/)

jaypas 08-06-2010 03:02 PM

Sudo Aureport Redirect output
 
Hi, All,

How do run aureport as root and redirect it's output to a directory that's only writeable by root?

Ex: sudo -u root aureport > /var/log/test.report
/var/log/test.report permission denied

/var/log has these permissions:
drwxr-xr-x root root

Thanks,
jaypas

Meson 08-07-2010 08:26 AM

Code:

sudo <command> | sudo tee /path/to/file
The output will appear on stdout AND the file. You might want stdout and stderr, in which case:

Code:

sudo <command> 2>&1 | sudo tee /path/to/file


All times are GMT -5. The time now is 04:18 PM.