I'm trying to create a small shell script that will use the rsync command to synchronize 2 directories and also will log to a file the success or not of the command and to another file the errors (not active network connection, etc). I'm stuck with the 2nd file, where I want to have the date and in a new line the output of standard error.
So far, I've done something like this:
if (rsync source destination) 2> /home/user/errors
echo "`date` - Success" >> /home/user/status
echo "`date` - Failure" >> /home/user/status