G'day,

I am just getting into rsync and have been very impressed with performance
and reliability.  There is one thing I haven't worked out how to do yet and
I haven't found much with several Google sessions or by way of consulting
the examples.

I am looking for a way to check for (or duplicate) single flag files to and
from a remote host (without any dummy spit errors when it is not present)
and ideally avoiding the need for a specialised sub directory for each flag
file.  For example to see if the remote host is otherwise occupied (i.e.. in
the middle of building the import data files) I was expecting this might
work for a "pull" action...

        rsync -vptgo [EMAIL PROTECTED]:/somepath/file1.flg file1.flg
      while [ -f file1.flg ]
                do
                sleep 30
                rsync -vptgo --delete [EMAIL PROTECTED]:/somepath/file1.flg 
file1.flg
        done
        # Now safe to transfer the data
        rsync -rvptgo [EMAIL PROTECTED]:/somepath/export import/

... then I want to drop a flag file on the remote host before a "push" rsync
starts and then remove it on completion. eg.

        touch file2.flg
        rsync -vptgo file2.flg [EMAIL PROTECTED]:/somepath/file2.flg
        rsync -rvptgo export/ [EMAIL PROTECTED]:/somepath/import/
        rm -f file2.flg
        rsync -vptgo --delete file2.flg [EMAIL PROTECTED]:/somepath/file2.flg

In my initial attempts the --delete options didn't seem to work to well on
single files.  I had thought of using discrete subdirectories for each flag
file so I can use the -r option with the --delete but I was hoping to avoid
this so a general solution would be much easier to deploy (and scale).

Is there a better way to achieve these goals using rsync or perhaps are
there better options using ssh alone?

Regards, Frank.


-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to