Thank you for the excellent software. I am finding it very useful and thus far is the superior means of ensuring my processes run one at a time.
I have two scripts and each script contains a command I want to limit to one instance. Each process runs 4x/hour offset by 10 minutes by cron:
script 1: 0,15,30,45
script 2: 10,25,40,55
Script 1 can often take more than 10 minutes to complete. This means that script 1 could be running while script 2 begins. This isn't a problem, script 1 grabs a bunch of data and script 2 processes it. I would like to lock script 1 so that a single connection to a remote server exists to grab new data. Script 2 needs to be locked because it writes data to a database and I don't want duplicate entries etc. I currently have flom running in script 2. Is it possible to ahve script 1 contain a flom as we well, permitting script 2 to run (the flom would block an additional script 1 from running not block script 2).
Many Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Jason, flom commands synchronize using resources.
If you don't specify the resource name (command line option "-r" or "--resource-name", config key "[Resource]/Name"), flom command will use a default resource: it's name is
_DEFAULT
but you will never see it, it's internal stuff.
If you need to synchronize indipendent processes, you can use distinct resources, as you have already figured out from Use Case #2.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you, Christian, for responding. I had in my cron: flom --resource-timeout=0 command args
so if I were to flom --resoure-timeout=0 --resource-name -- command args
this should work?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
for all the commands that you want to synchronize on the second resource (R2).
In the above example, command1 and command2 can run at the same time, but flom will avoid a parallel execution of two or more command1 and it will avoid a parallel execution of two or more command2.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good Day,
Thank you for the excellent software. I am finding it very useful and thus far is the superior means of ensuring my processes run one at a time.
I have two scripts and each script contains a command I want to limit to one instance. Each process runs 4x/hour offset by 10 minutes by cron:
script 1: 0,15,30,45
script 2: 10,25,40,55
Script 1 can often take more than 10 minutes to complete. This means that script 1 could be running while script 2 begins. This isn't a problem, script 1 grabs a bunch of data and script 2 processes it. I would like to lock script 1 so that a single connection to a remote server exists to grab new data. Script 2 needs to be locked because it writes data to a database and I don't want duplicate entries etc. I currently have flom running in script 2. Is it possible to ahve script 1 contain a flom as we well, permitting script 2 to run (the flom would block an additional script 1 from running not block script 2).
Many Thanks.
EDIT: Perhaps Case #2 is exactly what I described and as an extension permits locks on unlimited synchronized processes.
Dear Jason,
flom commands synchronize using resources.
If you don't specify the resource name (command line option "-r" or "--resource-name", config key "[Resource]/Name"), flom command will use a default resource: it's name is
but you will never see it, it's internal stuff.
If you need to synchronize indipendent processes, you can use distinct resources, as you have already figured out from Use Case #2.
Thank you, Christian, for responding. I had in my cron: flom --resource-timeout=0 command args
so if I were to
flom --resoure-timeout=0 --resource-name -- command args
this should work?
Dear Jason,
the option --resource-name needs an argument, the name of the resource.
You should use something like:
for all the commands that you want to synchronize on the first resource (R1).
You should use a second one:
for all the commands that you want to synchronize on the second resource (R2).
In the above example, command1 and command2 can run at the same time, but flom will avoid a parallel execution of two or more command1 and it will avoid a parallel execution of two or more command2.
Brilliant! Thank you very much, Christian. It was the "=R1" that I didn't figure out. It works beautifully.