I am building a twitter application where a user can enter a tweet and can schedule it to be posted once, daily, weekly, or monthly. What is the best way to implement a cron job for this action? I can only think of running a cron job every minute and matching up the times and dates – this can’t be the best solution as it would place a lot of stress on the server. I am running a lamp stack with ubuntu – any suggestions would be appreciated.
Share
A cronjob that is executed every minute is perhaps a bit of overkill if the lowest interval is once a day. On the other hand, a script that does a query every minute isn’t that much of a strain on a webserver as it probably can handle 1000 queries a minute on a relative low end server.
When your appliaction/website wil be used a lot you could starting about more optimalisation, but when your website/application gets that big, it is probably needed to run it every minute :).