Comments (6)
Hi,
This issue is indeed possible when allowing cron to be triggered from outside the server. If you can you should place a single trigger in your crontab. This way other can not trigger your cron more than you set it.
If you want to make sure you do not run the same job in parallel, you can implement a basic Semaphore that logs/locks the jobs started an releases the job finished/failed.
Hope this answer was of any help.
from cron.
Note: My implementation at the moment is an abstract of crontab. Crontab will have the same issue.
I don't see any harm in providing a way for users to solve this problem from within the library.
from cron.
If you can you should place a single trigger in your crontab
How do you do that ?
Do be sure not to write it twice I wanted to do a $string = exec(crontab -l)
and if the line exists, skip the creation of the crontab, else write it.
I must say that I'm a little confused about your answer: should my crontab -l
with php user return something?
from cron.
Your (unix) crontab should have something like:
* * * * * php /path/to/cron.php >/dev/null 2>&1
Inside the cron.php
file you initialize the app and trigger the $cron->run()
as the example in the readme.
To do this you will probably move your bootstrap code in a separate file and include it in both the webapp
and the cron.php
.
from cron.
Ok, maybe I didn't get the purpose of your bundle. What I wanted is that no one has to create a cronjob by hand: everything should be done by the website itself...
I finally ran 4 exec() to let php create the cron itself...
Thx anyway for your time
from cron.
Indeed, the library works the other way around. You create one unix cronjob to trigger the library. The library will allow your application to decide when and what jobs are executed.
from cron.
Related Issues (20)
- Add lowest dependecies tests.
- Need to wait for processes to stop (call job->wait()) HOT 3
- Weekday "7" not accepted HOT 3
- Unable to use full Process constructor.
- Support for Symfony 4 HOT 1
- Question: Removing & Adding Jobs HOT 2
- ShellJob->setCommand() fails
- Docker support
- Teste
- CrontabSchedule constructor argument type
- /var/spool/cron: chdir: Permission denied HOT 1
- Cron does not always start job with pattern * * * * * HOT 2
- Cron and the time zone HOT 3
- How to get generated report for job? HOT 2
- Php requirements HOT 2
- i gave this syntax for cron "17 17 18 2 5" but didnt execute my fucntion at that time, but "* * * * *" this one is working HOT 2
- Use of \DateTimeInterface instead of \DateTime HOT 1
- [Feature Request] Async task HOT 2
- Dependency Dashboard HOT 1
- Run Root application on boot without password. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cron.