From: i18n <i1...@ya...> - 2003-01-17 01:54:30
|
I am using a stock modified 2.0 slash.... I have writen a new daily mail program. The purpose of this is 2-fold: to allow me to use templates for generating the mail (probably in 2.2 already, right?) and to allow me to send multipart/alternative mail (including HTML). Now that I have this single purpose mail program, I need to reintegrate it with dailyStuff. First, I would strip out the daily mailing code from slashd. Then I would like to simply call my new program with a system call in slashd, in the same loop and immediately after dailyStuff. The existing slashd code looks like this: if (check_daily()) { slashdLog("It's Tomorrow: Run Slashd daily Voodoo"); system("$constants->{sbindir}/dailyStuff $virtual_user &"); # I wanna put my call here--------------------------- } At the end of dailyStuff there is a worrisome line and I am not sure of any side effects: # Now lets clean up the database $slashdb->deleteDaily(); Are there any timing issues involved with doing it this way? Will things get deleted from the database I need to create the mail? I suppose I could separate out the deleteDaily call to a third separate program, and force all 3 to run consecutively via a single system call. Is there a better way? BTW, Are the system calls in slashd presenting any kind of security risk? Thanks! Barry |
From: Alessio B. <al...@al...> - 2003-01-18 16:40:26
|
On Fri, 2003-01-17 at 03:55, i18n wrote: > I have writen a new daily mail program. > Now that I have this single purpose mail program, I need to reintegrate it with dailyStuff. I don't think you really need. > First, I would strip out the daily mailing code from slashd. Sure. > Then I would like to simply call my new program with a system call in slashd, in the same loop and immediately after dailyStuff. You can run it as a task in the tasks directory, they work just like cron. You follow the coding standard and add the information that sets the time when the task runs (in your case, some time after midnight every day), and you should IMHO have a cleaner system. I have a weekly newsletter that's delivered using this tecnique. -- Alessio Bragadini <al...@al...> APL Financial Services (Overseas) Ltd |
From: i18n <i1...@ya...> - 2003-01-18 17:57:08
|
Alessio, I am running 2.0x and don't have a task directory - is this new in 2.2? I am perfectly willing to run this as a cron job, but I hope for a clear explanation of what deleteDaily does. Will it cause anything to be reset as a side effect that would prevent the mailing from running possible *after* deleteDaily instead of *defintiely* before? >At the end of dailyStuff there is a worrisome line and I am not sure of any side effects: > # Now lets clean up the database > $slashdb->deleteDaily(); > >Are there any timing issues involved with doing it this way? Will things get deleted from the database I need to create the mail? >I suppose I could separate out the deleteDaily call to a third separate program, and force all 3 to run consecutively via a single system call. Is there a better way? Barry At 06:39 PM 1/18/2003 +0200, Alessio Bragadini wrote: >On Fri, 2003-01-17 at 03:55, i18n wrote: > >> I have writen a new daily mail program. >> Now that I have this single purpose mail program, I need to reintegrate it with dailyStuff. > >I don't think you really need. > >> First, I would strip out the daily mailing code from slashd. > >Sure. > >> Then I would like to simply call my new program with a system call in slashd, in the same loop and immediately after dailyStuff. > >You can run it as a task in the tasks directory, they work just like >cron. You follow the coding standard and add the information that sets >the time when the task runs (in your case, some time after midnight >every day), and you should IMHO have a cleaner system. > >I have a weekly newsletter that's delivered using this tecnique. > >-- >Alessio Bragadini <al...@al...> >APL Financial Services (Overseas) Ltd > > > >------------------------------------------------------- >This SF.NET email is sponsored by: Thawte.com - A 128-bit supercerts will >allow you to extend the highest allowed 128 bit encryption to all your >clients even if they use browsers that are limited to 40 bit encryption. >Get a guide here:http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0030en >_______________________________________________ >Slashcode-general mailing list >Sla...@li... >https://lists.sourceforge.net/lists/listinfo/slashcode-general |