X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org From: "David Christensen" To: "'The Cygwin Mailing List'" References: <7ine1pai DOT fsf AT cante DOT net> Subject: RE: Running perl script in cron in cygwin under Windows Date: Sun, 13 Jan 2008 21:51:34 -0800 Message-ID: <043901c85671$859ea900$0a00a8c0@a64x23800p> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Macalalad, Jun wrote: > I've been trying to run a perl script from cron in cygwin -- not > good. It runs when in a cygwin command prompt. Any idea where I've > done wrong please? Help? Do you have cron working? Verify it with a simple command, such as 'touch'. If that works, try a Perl one-liner such as the following: 20080113-214329 dpchrist AT a64x23800p ~ $ perl -e 'open FH, "> /home/dpchrist/hello.out"; print FH "hello, world!\n"' If all of the above works, I'd suspect the environment variables/ path -- cron doesn't set up the same environment as you get with an interactive login shell. My standard trick is to write a Bash shell script that sets up the environment (typically by invoking .bash_profile and/or .bashrc) and then launches the Perl script, and then have cron run the wrapper script. HTH, David -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/