From owner-freebsd-questions@FreeBSD.ORG Sun Jan 17 23:13:30 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9EA81065672 for ; Sun, 17 Jan 2010 23:13:30 +0000 (UTC) (envelope-from mikel.king@olivent.com) Received: from mail.olivent.com (mail.olivent.com [75.99.82.91]) by mx1.freebsd.org (Postfix) with ESMTP id 36C258FC0A for ; Sun, 17 Jan 2010 23:13:28 +0000 (UTC) Received: from localhost ([127.0.0.1]) by mail.olivent.com (Kerio MailServer 6.7.2) (using TLSv1/SSLv3 with cipher AES128-SHA (128 bits)); Sun, 17 Jan 2010 18:13:22 -0500 References: <91E8AD4B-C321-41C7-BA0E-E89E4D5CE40F@olivent.com> <6DDE69B1-E8FD-4889-ADA6-4F81BC30BC61@olivent.com> Message-Id: From: mikel king To: Diego Montalvo In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPod Mail (7D11) Mime-Version: 1.0 (iPod Mail 7D11) Date: Sun, 17 Jan 2010 18:12:59 -0500 Cc: "freebsd-questions@freebsd.org" Subject: Re: Running PHP File under Crontab... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 23:13:30 -0000 There are a couple of ways. My prefrence is to control the output directly from the app in PHP. However you should be able to pipe the output to a file without issue. Cheers, m! On Jan 17, 2010, at 15:48, Diego Montalvo wrote: > One other question, is there a way to copy the ouput of the crontab > "php" file to another file? > > Simply the "hello world" output and not the code... ?? > > 2010/1/17 mikel king : >> >> On Jan 17, 2010, at 3:01 PM, Diego Montalvo wrote: >> >>> I am using " >>> >>> 2010/1/17 mikel king : >>>> >>>> On Jan 17, 2010, at 2:30 PM, Diego Montalvo wrote: >>>> >>>>> CLI meaning, if I can run and excute >>>>> in >>>>> command line, a php file can run in crontab? doing the >>>>> following in >>>>> shell: "# php helloworld.php" - "hello world" is produced... >>>>> >>>>> Thanks! >>>>> >>>>> >>>> >>>> >>>> ok then do you have #!/usr/local/bin/php as your first line of the >>>> script? >>>> Or are you using the bash exec command to run the code in your >>>> shell >>>> script? >>>> >>>> Also you can try placing the path to the php CLI executable in the >>>> crontab. >> >> >> If your php executable is in /usr/local/bin then replace /bin/sh >> with that >> in your script file. >> >> #!/usr/local/bin/php >> >> > >> echo "Hello cruel world!!!\n"; >> >> ?> >> >> Remember to chmod +x the script file. >> >> m! >> >> > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org > "