gattass69
gattass69

Reputation: 101

The best way to create cronjob automatically? (If it is possible)

i'm wondering if it is possible to automatically create cronjob everytime i get a link to a feed rss on my website, to keep track of every post of the post inside those feed rss.

And i'm wondering also if there is a better solution instead of create a cronjob for each feed rss.

(i already know how to get post from feed, i just want to know if and how its possible to do that thing with cronjob)

Currently i've this table on db:

---------------------
|      FEED_RSS     |
|-------------------|
|id | title | link  |
|-------------------|
| 1 | feed1 | link1 |
| 2 | feed2 | link2 |
| 3 | feed3 | link3 |
| 4 | feed4 | link4 |

Those values ar recorded by an input text from users.

So, is a good solution to create multiple cronjob? And first of all, can i do that dinamically for each record of the database? if yes...how should i do that?

(i already know how to get post from feed, i just want to know if and how its possible to do that thing with cronjob)

Upvotes: 0

Views: 203

Answers (1)

vchabot
vchabot

Reputation: 581

You can do this automatically by using a Queue messaging system, like RabbitMQ, and every time you have a new insertion in database, you send a message to RabbitMQ, and you need a consumer to do the job from your crontab.

But maybe it's a too big solution.

Upvotes: 2

Related Questions