SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2001
    Location
    Beautiful BC, Canada
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help! Daily event using wget

    I'm writing an ezine/followup script and I'm using a dailymail.php script to process the daily followup emails. The best way to run this script is by using wget as I don't want my users to need to know too much (like their home directory on the web host) to use the script. Running the script with wget will ensure it's executed from the same directory as the config.php file. The problem is, wget saves files with the output of the page it grabs. Even though dailymail.php produces no output it still creates a file of 0 bytes.

    I don't really want to run dailymail.php from the commandline via a PHP command line interpreter as, like I said before, that would require my users to know their home directory (to include the config.php file with the database information)...

    Does anyone have a better solution or perhaps enough knowledge of wget to provide a workaround? Basically it works perfectly other than the files being saved.

    My script so far can be found at http://mfware.com/listmaildemo .. you can test it by entering "demo" as the password.

    Please reply with your thoughts on a solution.

    Dean

  2. #2
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use lynx instead?

    lynx -dump http://localhost/script.php > /dev/null

    That will cause lynx to dump the page accessed straight to /dev/null - I'm using at the moment in a cron job thingy to update my signature once every ten minutes on another forum Someone posted that solution on these forums a while back (can't remember who) and it's proved extreemly useful ever since.

  3. #3
    SitePoint Member
    Join Date
    Jun 2001
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Skunk
    Use lynx instead?

    lynx -dump http://localhost/script.php > /dev/null

    That will cause lynx to dump the page accessed straight to /dev/null - I'm using at the moment in a cron job thingy to update my signature once every ten minutes on another forum Someone posted that solution on these forums a while back (can't remember who) and it's proved extreemly useful ever since.
    Could someone explain to me what /dev/null is?

    I've tried the above suggestion but it causes an email to be sent to me with the following message: "Your terminal lacks the ability to clear the screen or position the cursor."

    Any idea how I can avoid getting this emailed to me? (the script does run and that's nice).

    thanks,
    john

  4. #4
    SitePoint Enthusiast vsantola's Avatar
    Join Date
    Jan 2001
    Location
    Portugal
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    /dev/null is something like a "empty device" in *nix systems that is used to send output that you don't want to use... something like a garbage collector
    Valter Santos

    rooco is my creature (a mix of a bear with a kanguroo)... he is trained in perl, PHP and is getting a java certification right now


Bookmarks

Posting Permissions

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