I need a simple logic idea what can be done in the below shell script.
I written a script to do a automated maintenance work on every month of 15th and I have scheduled it through the crontab. I need to send an alert email to the user before 24 hrs of that maintenance script run.
do I need to schedule a script script for the alert email before the main script.
You make a script to execute, in which (suggested) full paths to the 'executed' files lead (aka, /bin/mail [opts] [args]).
Then you add the crontab line, to exectue above script.
before executing the original script in crontab I need to intimate to the user that maintenance script will run in next 24 hrs.
can you tell me how I can send it.
For this i would recomend to use 2 crontab entries and 2 scripts.
First crontab/script to inform the admin/user that the maintainance script will run in 24 hrs (so the next day)
Second crontab/script to execute the maintainance script.
For how to send a local mail to the user, please use the search function of the forum.
Search for like: send mail
And have a look at some code blocks in the listed threads.