LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-13-2014, 12:59 PM   #1
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Bash script queueing


I've got 'iwatch' looking at a directory, and when a particular file is created I want to run an rsync.

The catch is,.. if 10 files are created simultaneously, I dont want 10 scripts running rsync jobs.

Im thinking the only way to do this is to have a queue process which notes the file that was made in a text file serially, and a sync process which reads that file one line at a time and syncs them.

What say you?
 
Old 06-13-2014, 01:20 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,890
Blog Entries: 13

Rep: Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934
Don't know anything about iwatch, but can you time it to only check once a minute, hour, or day or something? Can you write the script to check first and see if there are other instances running already and then exit and let the first instance finish? Not sure if that second option has other complications; like it doesn't fully sync because the directory state was not yet resolved. But that would be the job of the next iteration anyways. The whole problem is if checking is being performed at the same time alteration is occuring; then the follow on action may not be timed properly or fully effective because the directory was in transition.
 
Old 07-07-2014, 02:04 PM   #3
canussie
Member
 
Registered: Jun 2014
Location: Calgary
Posts: 50

Rep: Reputation: 7
Check this out:
http://vicerveza.homeunix.net/~viric/soft/ts/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH connection from BASH script stops further BASH script commands tardis1 Linux - Newbie 3 12-06-2010 08:56 AM
queueing packets with iptables soltani Linux - Software 2 05-05-2009 03:51 AM
Sounds seem to be queueing instead of all playing at once lmetal Slackware 3 08-31-2004 08:26 PM
Sound queueing problem Pathian Linux - General 1 01-09-2004 05:04 PM
mail still queueing joseph Linux - General 0 08-21-2003 08:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:57 PM.

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