LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to create error log for tarball (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-error-log-for-tarball-118897/)

everythingand2 11-22-2003 12:37 PM

how to create error log for tarball
 
This is a pretty simple question...

I have a script that runs in cron which backs up a certain directory and saves it to a file. I'm wanting to also display any error messages while doing this backup in a separate file. What would the syntax be for this? This is what I have right now:

tar -c /usr/local/backups/htdocs.bak > /usr/local/backups/htdocsbak.tar

Thanks,
Brad

Mara 11-22-2003 03:38 PM

Something like
tar -c /usr/local/backups/htdocs.bak > /usr/local/backups/htdocsbak.tar 2>/use/local/backups/errors

'2' is standard error output. 2>/somewhere command redirects standard erro output (whet means: error messages) to the file.


All times are GMT -5. The time now is 05:48 AM.