Cron Email Output from wget

software development

#1

Hello,

I successfully set up my cron job. I went for :

Because when using:

          • /dh/cgi-system/php5.cgi /home/youruser/yourdomain.com/path-to-php5-script.php
            The script couldn’t connect to MySQL.

However in the email response from the cron I wanted to get the output of the script. This was working with CGI but not wget. Is there any way to do it? I tried removing the -q param, but that just sends the http connection process details.

Thanks a lot!


#2

Documentation on many commands and programs is available from the shell or a search engine query like “man [command]”

http://linux.die.net/man/1/wget

In this case you’ll want to use -O,the option for printing the content to a file, in order to get the contents printed to standard output. Or if you are saving the contents to file anyways just a ‘cat’ command to print the saved file.

Customer since 2000 :cool: openvein.org


#3

Thanks a lot for that link Atropos, I never used wget before so it’s very useful :slight_smile:

To confirm, the correct cron to get wget output sent to email (and not saved as file) is:

I just saw in the Wiki (http://wiki.dreamhost.com/index.php/Cron#Executing_a_PHP_Script_with_Crontabs) this one:

I’m assuming this is an alternative that does the same thing?

Thanks again


#4

The Wiki says it does. Please let us know if you try it and it works for you!

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost