Bob,

Your reply just made me notice that I replied to you directly, instead 
of to the mailing-list. So, I resent my message for the benefit of the 
others.

On Wed October 24 2007 20:06, Robert Smits wrote:
> What does the first line with "#!/bin/bash" do? I understand it's a
> descriptive comment, but what does the !/bin/bash do for you.

It is not a comment. While # starts comments anywhere else in a bash 
script, if the script starts with  "#!/bin/bash", bash will be used to 
interpret the script, even if someone's login shell is csh or tcsh. For 
example, if I had used the Bourne shell syntax, I should start my 
script with #!/bin/sh.

> Second, I've been using rsync in the form rsync -a source file
> location destination file location. Is it because you want to do this
> interactively that you've added all these other options?

The fundamental difference is that both ends are active. If I was just 
mirroring my home to a passive backup destination, then a pure 
--archive option would suffice and I would probably do it on my entire 
$HOME. But in my case, I synchronize only key directory trees between 
the 3 machines and any of the 3 can have a more recent version of a 
document. 
--compress: speeds up synchronization between office and home.
--update: prevents overwriting a newer version on the destination, if I 
forgot to update it in the source first. Say I change 
Projects/ABC/file1 in the office and forget I changed it. Then I work 
on Projects/ABC/file2 at home. If I didn't use update, I would revert 
to the old version of file1 when I archive Projects/ to the office. 
--partial --delay-updates: keep partial transfers if the connection 
breaks, so a restart only transfers the rest. The problem is the time 
of a partial file is always newer, since the time stamp is adjusted at 
the end. So, at restart a partial file would not only look complete, 
but also more recent, and when I synchronize back, I would corrupt the 
source, hence delay-updates.
--progress: just to see that the connection is not hanging in case of 
large files.

> > I found that sometimes I forgot that I created a new file in the
> > office, say under Projects/ABC/, and when I work from home and I
> > want to "syncsend Projects", it asks if I want to delete that new
> > file. I then say "no" and subsequently run  "syncget Projects" to
> > bring that file to my desktop at home.
>
> But if i use the rsync command without the --delete parameter it
> won't delete any files at all on the receiving side, right? And if I
> have an extra one in either receiving or sending side, it'll add it,
> right?

Your synchronization is always one way, never back and forth at once. 
Without --delete, rsync will notice that there is an extra file at the 
destination, which would normally mean you deleted the corresponding 
file in the source, but rsync will not synchronize this deletion. rsync 
cannot know that in my case the destination side is not a pure backup 
site and that it can also generate new content. I have to run "rsync 
office home", which is "syncget" in this case, for rsync to bring the 
new file to my home machine.

> Well.my scripts were much more primitive and I'll study yours to see
> how they add functionality. Once I have the scripts working I just
> want to run them daily with cron.

These are just different scenarios. I would use a cron job to sync to a 
true, passive backup site. Since all my sites are active and I am 
somewhat absent-minded, my initially simple interactive script evolved 
to this. :)

-- 
Carlos FL

Who is General Failure, and why is he reading my disk?
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to