Rsync command and verbose log
Maxime Alarie
malarie at processia.com
Thu Apr 29 20:50:11 UTC 2010
If I can suggest a more friendly date..
#!/bin/bash
DATE=$(date +%Y-%m-%d) will output: 2010-04-29
Regards
-----Original Message-----
From: ubuntu-users-bounces at lists.ubuntu.com
[mailto:ubuntu-users-bounces at lists.ubuntu.com] On Behalf Of Richard
Mancusi
Sent: Thursday, April 29, 2010 1:41 PM
To: Ubuntu user technical support,not for general discussions
Subject: Re: Rsync command and verbose log
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>
--
ubuntu-users mailing list
ubuntu-users at lists.ubuntu.com
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
More information about the ubuntu-users
mailing list