Hi. I installed the rsync and I need it to run every 5 seconds between 2 machines. I was planning to use it in crontab, but this allows only every minute. I couldn?t find how to do it. Could someone explain me how to run rsync automatically every 5 seconds? Thanks in advance, Mauro
A simple way would be to write an infinite loop shell script: -------------------- #!/bin/bash while [ 0 == 0 ] do rsync ... sleep 5 done ------------------- This, however, does not ensure that rsync is called every 5 seconds "on the clock", just that 5 seconds pass between two consecutive calls. /Greger On Wed, 2 Jul 2003 10:32:51 -0300, Mauro Nunes (SAO PAULO/EDB) <mauro.nunes@ericsson.com> wrote:> Hi. > > I installed the rsync and I need it to run every 5 seconds between 2 > machines. > > I was planning to use it in crontab, but this allows only every minute. > > I couldn?t find how to do it. > > Could someone explain me how to run rsync automatically every 5 seconds? > > Thanks in advance, > > Mauro > -- > To unsubscribe or change options: > http://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html >
Every 5 seconds seems a bit excessive in terms of CPU utilization and network bandwidth. Are you trying to ensure close-to-real-time synchronization by doing this? If you have the ability to run processes on the source machine, perhaps running a process that monitors the source directory for changes and then runs rsync when changes occur would reduce overhead? Others with more experience may have better ideas. jpt> -----Original Message----- > From: Mauro Nunes (SAO PAULO/EDB) [mailto:mauro.nunes@ericsson.com] > Sent: Wednesday, July 02, 2003 9:33 AM > To: 'rsync@lists.samba.org' > Subject: Rsync utilization every 5 seconds > > > Hi. > > I installed the rsync and I need it to run every 5 seconds > between 2 machines. > > I was planning to use it in crontab, but this allows only > every minute. > > I couldn?t find how to do it. > > Could someone explain me how to run rsync automatically every > 5 seconds? > > Thanks in advance, > > Mauro > -- > To unsubscribe or change options: > http://lists.samba.org/mailman/listinfo/rsync > Before posting, read: > http://www.catb.org/~esr/faqs/smart-questions.html >
If you insist on every 5 seconds: -------------------------- #!/bin/sh while : do rsync [opts] SRC DEST sleep 5 done ----------------------------------------------------------------- Todd Joseph Director, Network & Systems Architecture Groove Networks P: 978-720-2129 mailto:todd_joseph@groove.net |---------+-----------------------------------------------------------> | | "Tillman, James" <JamesTillman@fdle.state.fl.us>| | | Sent by: | | | rsync-bounces+todd_joseph/groove=groove.net@list| | | s.samba.org | | | | | | | | | 07/02/2003 09:41 AM | | | | |---------+-----------------------------------------------------------> >----------------------------------------------------------------------------------------------| | | | To: "'rsync@lists.samba.org'" <rsync@lists.samba.org> | | cc: | | Subject: RE: Rsync utilization every 5 seconds | >----------------------------------------------------------------------------------------------| Every 5 seconds seems a bit excessive in terms of CPU utilization and network bandwidth. Are you trying to ensure close-to-real-time synchronization by doing this? If you have the ability to run processes on the source machine, perhaps running a process that monitors the source directory for changes and then runs rsync when changes occur would reduce overhead? Others with more experience may have better ideas. jpt> -----Original Message----- > From: Mauro Nunes (SAO PAULO/EDB) [mailto:mauro.nunes@ericsson.com] > Sent: Wednesday, July 02, 2003 9:33 AM > To: 'rsync@lists.samba.org' > Subject: Rsync utilization every 5 seconds > > > Hi. > > I installed the rsync and I need it to run every 5 seconds > between 2 machines. > > I was planning to use it in crontab, but this allows only > every minute. > > I couldn?t find how to do it. > > Could someone explain me how to run rsync automatically every > 5 seconds? > > Thanks in advance, > > Mauro > -- > To unsubscribe or change options: > http://lists.samba.org/mailman/listinfo/rsync > Before posting, read: > http://www.catb.org/~esr/faqs/smart-questions.html >-- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html