Answer the question
In order to leave comments, you need to log in
How to check dates against the current one?
Please help with checking dates. There is a table with users with e-mail and date of birth. How to write a script to check dates with the current date, if it matches, then send a letter of congratulations? The script must run via cron.
Answer the question
In order to leave comments, you need to log in
Well, for this, the language is not needed, it is enough to bash
in the cron, just throw the script itself, as I understand it, check once a day.
So it will be something like this, say at 8:10 every day
date grep sendmail
will help you with 2 lines of code.
search the file for a line containing the current date pass it to sendmail that's all
How to write a script? Hands apparently using the keyboard.
Where is the code? That does not work?
SELECT *
FROM users
WHERE date_format(now(), '%m-%d') = date_format(birthday, '%m-%d')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question