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



Hi Chuck,

On Fri, Nov 11, 2011 at 08:52, Charles Muller <cmuller-lst@example.com> wrote:
I usually synchronize my various machines via my server, manually
starting an rsync routine on startup or shutdown of Linux.

I was thinking that I might be able to automate this by having a script
that compares the time stamps of a designated file on the server with a
designated local file, and then depending on if there is a difference,
and if so, which way, the appropriate rsync routine would start up.

I know how to compare the time stamps on local files, but comparing a
local file with a file on the server seems to need a different kind of
technique.

I was thinking that I could:

(1) include a line at the end of my regular rsync backup routine up to
the server that writes a new file, like "filetest2" on the server, and
writes another file, like "filetest1" on my local machine.

(2) Have a short rsync sript that runs on startup that downloads
"filetest2" to my local machine (which in the meantime may have been
updated due to a backup having been done from another machine) and if
"filetest2" is newer, run the rsync routine from the server down to my
local machine.

Does this make sense? Or is there a simpler way to do it?

I don't understand the question... Just run your usual rsync script, it should just work...
Time is *not* localtime in Unix/Linux systems, but UTC...

Therefore, if your machines are quite correctly time-synced, it will just work...

If you are are not sure about the accuracy of time sync, please useĀ  "--modify-window" option, and add a few seconds (what I always do for backups: 1 sec).

Regards,

Bruno.


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


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links