Perform operation whenever dir is altered

  • Thread starter Henry van der Beek
  • Start date
H

Henry van der Beek

Hello,

I am trying to synchronise two directories across a network. This is
no problem; I have been using rsync and it is working fine. However,
rsync is normally triggered by cron, ie. at a given time interval, and
I want it to be used whenever the contents of the directory is
altered. This is probably a case of synching just the particular file
that has been altered.

So, for every file in the directory, I want to trigger an rsync
command whenever that file is edited. This functionality needs to
cover any file type, and the directory needs to appear on both
machines as a normally mounted directory. (We are running redhat9.0 on
both machines

Does anyone know of a way of customising a directory in this way, or
does anyone have any ideas of areas where I should be looking to
achieve this kind of thing.

Thanks a lot,
Henry
 
J

John Lenton

Hello,

I am trying to synchronise two directories across a network. This is
no problem; I have been using rsync and it is working fine. However,
rsync is normally triggered by cron, ie. at a given time interval, and
I want it to be used whenever the contents of the directory is
altered. This is probably a case of synching just the particular file
that has been altered.

So, for every file in the directory, I want to trigger an rsync
command whenever that file is edited. This functionality needs to
cover any file type, and the directory needs to appear on both
machines as a normally mounted directory. (We are running redhat9.0 on
both machines

Does anyone know of a way of customising a directory in this way, or
does anyone have any ideas of areas where I should be looking to
achieve this kind of thing.

if both ends are Linux, you could use dnotify. If both ends are some
flavour of Unix, you could use famd.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top