Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: cron script can awk wget file but not head/cat it Date: Fri, 9 Sep 2005 16:11:27 -0600 Message-ID: <3C46C4ED0F9B944690547357EB7F1C0F04A481@COFORTCOL2S304.agwest.one.usda.gov> From: "Pagano, Tom - Portland, OR" To: "Eric Blake" , Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j89MBfxJ007524 Thank you for the very prompt response. If I assume that it's the System that's running the script via the cron, isn't System the owner of the file that results from wget? Or do wgetted files belong to someone else? And do Awk and Cat require different permission levels (presumably awk is more lax than cat because even though they were doing the same thing, cat couldn't see the file contents whereas awk could). Besides, from my ls in my previous mail, it appears to me that user-group-other all have read permissions to all the files so it shouldn't even matter? Do you have any recommendations on how I can change my script or some setting to fix the problem? I could change all my cat and head statements to awk statements, but that seems more like treating the symptom rather than the disease. Thanks Tom -----Original Message----- From: Eric Blake [mailto:ericblake AT comcast DOT net] Sent: Friday, September 09, 2005 2:23 PM To: Pagano, Tom - Portland, OR; cygwin AT cygwin DOT com Subject: Re: cron script can awk wget file but not head/cat it > > And sntl_data_moved_then_headed.csv contains: Cannot open file > /home/tompagano/test/sntl_data_moved.csv > This is a simplification of a much broader script I've been trying to run that > was failing, but I've been able to isolate it down to this specific problem. I'm > quite baffled as to why moving then awking a file would give a different result > than catting or heading. It doesn't appear to be a permissions issue as far as I > can tell because I can still move the files around? Am I missing something here? Yes - remember that cron scripts run as the SYSTEM user, so they have different access permissions than the command line. When you use cp, and a new file is created, the new file is owned by the current user; but when you use mv, the renamed file maintains the same owner. Based on who owns what, your cron script can't read files depending on how those files were obtained and moved/copied. -- Eric Blake -- 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/