Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
devTea219106y@asgs does it trigger automatically? Can I put a schedule with it or something?
Edit: nvm my friend tried using cron @jespersh -
asgs112756y@devTea I'm not sure about scheduling (think it is not possible), but yes it is automatic. It happens automatically based on some condition you specify.
Ref - https://dev.mysql.com/doc/refman/... -
Usually such things are done by a layer managing the database. Either a manual cron on the server itself, or a higher level managing tool like ansible, or the backend framework like Laravel (kernel job scheduling) or Django (django-cron), or on Amazon you'd set up a scheduled lambda function, etc.
So it kind of depends what kind of systems the DB is interacting with :) -
bahua128016yWrite a script to make the update. Then add it to the applicable user's crontab. The following line will run it at 2:15AM on the 10th of every month.
15 2 10 * * /home/shirtpants/bin/fixdb -
hitzoR2636yNot sure about Postres, but MySQL has built-in scheduler. There is really no need for cron or even some external server for simple thing like that. If the server provider allows it ofc.
-
@bahua @hitzoR Depends on who/what manages the DB server.
If you have a backend web framework with a scheduler, it might be a better place -- easier to find, stored in git, transparent to other devs. Seemingly random changes in your database might be puzzling to other maintainers, unless they know about "show events from database".
Related Rants
-
cdrice105"You gave us bad code! We ran it and now production is DOWN! Join this bridgeline now and help us fix this!" ...
-
gururaju56*Now that's what I call a Hacker* MOTHER OF ALL AUTOMATIONS This seems a long post. but you will definitely ...
-
corjaantje29And the most useless function of the year award goes to...
Is there automation tool for postgres or mysql to fire a query? I got a db that will reset the row column value after 1 month of the created date
Edit: I know this is not SO
Not clearing the rows, just resetting the value of some rows if the criteria is met
question
automation
db