On Thursday 16 November 2006 11:29, Mark D Pace wrote:
>I've written a rexx program to run under cron to do clean up on a
>directory. It runs fine when I run it myself, but it fails under cron.
>Trace output from the cron run job shows
>
>"sudo ls -lGgh /srv/ftp/pub"
>"-r--r--r-- 1 14M Nov 7 16:02 GE_Mainline_Ansys ver2.ppt"
>
>HUH? when I do it manually the output is
>"sudo ls -lGgh /srv/ftp/pub"
>"-r--r--r-- 1 14M 2006-11-07 16:02 GE_Mainline_Ansys ver2.ppt"
>
>If I manually do an ls command I get the format with the date as
>yyyy-mm-dd. Why would the ls command under cron get a date format of
>Month Day?
Sounds like an environment difference, but I can't think of one that would
change that. That YYYY-MM-DD format is not the normal ls(1) output I'm used
to seeing, so I suspect your shell has something in its environment that
changes it. Do "env | grep LS" to look for any environment variables related
to ls. Use /bin/ls directly instead of letting your shell search your PATH.
Is POSIXLY_CORRECT set?
I'm not able to get my ls to produce that form of output. Your cron job is
producing the normal output that I'm used to seeing. The closest I get to
your shell output is using the --full-time option, but that gives even
stranger output:
-rw-r--r-- 1 mack users 0 2006-11-16 11:49:44.000000000 -0500 foo
I hope this helps!
- MacK.
-----
Edmund R. MacKenty
Software Architect
Rocket Software, Inc.
Newton, MA USA
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390