Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    log file autoemailed to me??

    hi

    i made my site in PHP ..the log file is created daily on my site.it is a simple .txt file

    the prefix for the file is based on date on the server for example

    if the date on the server is 10.23.2003 then the log file for that day will be 10.23.2003.txt .Now as the sever date changes a new text file is created and it starts recording the log data..


    now i want some script to automail me that last day text file once

    does any one know what Code or way it can b done??i want the file to b mailed to my address only once automatically.
    Move on....

  • #2
    Regular Coder
    Join Date
    May 2003
    Location
    34° 54' N 82° 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You will have to write cron job to execute the script to mail it to you at a certain time of each day....
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #3
    New Coder
    Join Date
    Sep 2003
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If 1 person visits your site every 24 hours, you could set up well, a sort of "job"

    use a mysql db, then time sent

    Duration of time Time in Seconds
    One Second 1
    One Minute 60
    One Hour 3600
    One Day 86400

    If time last sent is <= less than or equal to 86400 in the mysql db, then mail the thing and write new time sent.
    no need for an else.

  • #4
    Regular Coder
    Join Date
    May 2003
    Location
    34° 54' N 82° 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That wouldn't work. The script would have to be ran manually for that to happen. If you wanted the script to mail it at 2 AM, then you would have to have someone run the script at 2 AM. With a cron job, It will run automatically....
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #5
    New Coder
    Join Date
    Sep 2003
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, but for people without cron (people using windows (for a server... lol...))
    then if you site gets 1 user each 24 hours minimum thenit will run, if you get alot more then it should work.

  • #6
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    You could do it without cron, if it was only to be sent once a day and not at an exact time. Could just use a db and once someone visits the site for the first time that day, update a table field to make the query never execute again for that day.

    <edit> I guess I shouldn't leave the reply page on for so long, basically saying the same as acecool did</edit>
    Last edited by Nightfire; 10-26-2003 at 03:20 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •