LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 06-02-2020, 12:39 PM   #1
kalyan1709
LQ Newbie
 
Registered: Nov 2008
Posts: 1

Rep: Reputation: 0
Unhappy incrontab rsync


Hi,

I am trying to rsync a folder to multiple destinations

EX:
1. /data/xyz/abc/ IN_CREATE,IN_DELETE,IN_CLOSE_WRITE /usr/bin/rsync --exclude '*.tmp' -a /data/xyz/abc/ user1@host1:/data/kalyan/

2. /data/xyz/abc/ IN_CREATE,IN_DELETE,IN_CLOSE_WRITE /usr/bin/rsync --exclude '*.tmp' -a /data/xyz/abc/ user1@host2:/data/test/kumar/

Here 1st one is perfectly syncing but the 2nd one never works. Like this I am trying to rsync "/data/xyz/abc/" to multiple servers in multiple locations.
When I run rsync manually(/usr/bin/rsync --exclude '*.tmp' -a /data/xyz/abc/ user1@host2:/data/test/kumar/) it is working with out any errors but in incrontab it won't trigger automatically like #1

Any help please?

Last edited by kalyan1709; 06-02-2020 at 01:02 PM.
 
Old 06-02-2020, 04:06 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,759

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
My guess is once inotify is triggered the second job will never run since it is watching the same directory. Move both rsync commands to a single script and have incron run that script instead of two entries.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set incrontab in bash scripting ??? abubakar-malik Linux - Newbie 4 03-01-2016 08:33 AM
Incrontab Directory Change (watched Folder = Mounted FTP Account) kunalks Linux - Software 2 05-25-2015 11:18 AM
[SOLVED] Not able to run incrontab jobs yogesh_attarde Linux - Software 6 05-28-2013 03:56 AM
Help with INCRONTAB syntax... boxenberg Linux - Server 3 03-02-2009 03:28 AM
incrontab cron how to combine commands afonit Linux - Software 3 01-30-2009 02:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 06:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration