Rsync command and verbose log
Richard Mancusi
vrman49 at gmail.com
Thu Apr 29 17:40:43 UTC 2010
On Thu, Apr 29, 2010 at 12:20, Vijay Shanker Dubey <vijay.shad at gmail.com> wrote:
> Hi,
> I am creating a script to sync my important documents between two system. I
> want my script to generate a log file for the last action. can you suggest
> me a way to achieve this.
> Question: If I execute the rsync command with -v flag, it will print a lot
> of messages on the console. Is there any way. So, I can redirect these logs
> to a file?
>
> Regards,
> Vijay Shanker Dubey
>
write a script something like this:
(yes I know some of the flags are redundant)
replace the <> with your data
last 2 echos simply place 2 blank lines between one log
entry and the next
#!/bin/bash
DATE=`date`
echo $DATE BackUp Started: <your source> to <your destination> >> <log
file name>
rsync -e ssh -raPH -v >> <log file name> --delete <data to copy> <ip>:
rsync -e ssh -raPH -v >> <log file name> --delete <more data to copy> <ip>:
rsync -e ssh -raPH -v >> <log file name> --delete <more data to copy> <ip>:
rsync -e ssh -raPH -v >> <log file name> --delete <more data to copy> <ip>:
echo $DATE BackUp Finished: <your source> to <your destination> >>
<log file name>
echo >> <log file name>
echo >> <log file name>
More information about the ubuntu-users
mailing list