Mailing List Archive


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

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



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?

Chuck

--------------------------------------
Charles Muller
Center for Evolving Humanities
University of Tokyo
www.acmuller.net





Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links