Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Run rsync based on time difference between local file and server file



On Fri, Nov 11, 2011 at 14:53, Charles Muller <cmuller-lst@example.com> wrote:
OK, I think I have an idea how to do this:
rsync  -uvp -e ssh chuck@example.com:/directory/testfile1 /home/chuck/
if [ testfile1 -nt testfile2 ]; then
{Run rsync scripts down from server}
fi
if [ testfile1 -ot testfile2 ]; then
{Run rsync scripts up to server}
fi

...except that there might be UTC issues. It's late, I'll play with
it tomorrow.

I would not go this way... Rather, I would just run the rsync all the time both ways...
This will avoid a manual time check for each file...

So the script would be (with correct rsync time check options):

{Run rsync scripts down from server}
{Run rsync scripts up to server}

Bruno.

PS. Attached is the one-way script I use for my backups. It uses hard links to keep different versions (day/week, etc...).
It does not answer your question at all, but may be useful for some TLUG users... Alternatively, you may use it both ways,
it would help you: Just remove the year/month/week/days as required.

--
2 + 2 = 5, for very large values of 2.

Attachment: sync-br.sh
Description: Bourne shell script


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links