<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: exporting date range in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836695#M272633</link>
    <description>and here is a Perl equivalent, but the previous example is more powerful and more easily changed:&lt;BR /&gt;&lt;BR /&gt;sjj_date=$(perl -e '($mday,$mon,$year) = (localtime(time() - (2 * 86400))) [3,4,5]; printf("%04d/%02d/%02d",$year + 1900,$mon + 1,$mday)')&lt;BR /&gt;export sjj_date&lt;BR /&gt;&lt;BR /&gt;(I think I got all of them "()'s" right.)</description>
    <pubDate>Thu, 03 Aug 2006 09:36:49 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2006-08-03T09:36:49Z</dc:date>
    <item>
      <title>exporting date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836693#M272631</link>
      <description>Hello all.&lt;BR /&gt;&lt;BR /&gt;I have a script where I am exporting today's date, but I really want to export a date range from today going back 2 days. &lt;BR /&gt;&lt;BR /&gt;This is what I have so far;&lt;BR /&gt;&lt;BR /&gt;export sjj_date=`date "+%Y/%m/%d"`&lt;BR /&gt;&lt;BR /&gt;Thanks,</description>
      <pubDate>Thu, 03 Aug 2006 09:13:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836693#M272631</guid>
      <dc:creator>Mike Tufariello</dc:creator>
      <dc:date>2006-08-03T09:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: exporting date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836694#M272632</link>
      <description>Well it's not obvious that when you specify one date that you have a range but the following will get you 2 days prior to today in YYYY/mm/dd format --- and it will work across month and year boundaries (including leap years):&lt;BR /&gt;&lt;BR /&gt;sjj_date=$(caljd.sh -S "/" -y $(caljd.sh -p 2))&lt;BR /&gt;export sjj_date&lt;BR /&gt;&lt;BR /&gt;Invoke the attached script as caljd.sh -u for full usage and examples.&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Aug 2006 09:19:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836694#M272632</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-03T09:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: exporting date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836695#M272633</link>
      <description>and here is a Perl equivalent, but the previous example is more powerful and more easily changed:&lt;BR /&gt;&lt;BR /&gt;sjj_date=$(perl -e '($mday,$mon,$year) = (localtime(time() - (2 * 86400))) [3,4,5]; printf("%04d/%02d/%02d",$year + 1900,$mon + 1,$mday)')&lt;BR /&gt;export sjj_date&lt;BR /&gt;&lt;BR /&gt;(I think I got all of them "()'s" right.)</description>
      <pubDate>Thu, 03 Aug 2006 09:36:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836695#M272633</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-03T09:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: exporting date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836696#M272634</link>
      <description>Hi Mike:&lt;BR /&gt;&lt;BR /&gt;If all you want is 2-days ago, this will do:&lt;BR /&gt;&lt;BR /&gt;# export sjj_date=`perl -MPOSIX=strftime -le 'print strftime "%Y/%m/%d",localtime(time-(86400*2))'` &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 03 Aug 2006 09:50:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836696#M272634</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-08-03T09:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: exporting date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836697#M272635</link>
      <description>I'm sorry guys.  I guess I probably phrased my question wrong.  What I am trying to do is display to the screen all jobs that are currently running.  I have a script that displays all jobs running for today, only, that were started after midnight.  If a job was started prior to midnight and is still running after midnight my script only displays the jobs started after midnight and ignores the job that is still running that was started prior to midnight.  Because it only looks for "today's" jobs, not yesterday's.  Ideally, I want to display all jobs currently running no matter how long ago they started.  Normally we would not let a job run more than 24 hours no matter when it started.  So just checking back for the last 24 hours would probably be enough.&lt;BR /&gt;&lt;BR /&gt;Thanks,</description>
      <pubDate>Thu, 03 Aug 2006 10:01:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836697#M272635</guid>
      <dc:creator>Mike Tufariello</dc:creator>
      <dc:date>2006-08-03T10:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: exporting date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836698#M272636</link>
      <description>Well, I not guessing that was a very poor way of expressing your problem. I will help to this extent:&lt;BR /&gt;&lt;BR /&gt;Run this command:&lt;BR /&gt;UNIX95= ps -e -o comm,pid,etime&lt;BR /&gt;&lt;BR /&gt;Notice that the etime (Elasped time) column changes its format when a process has been running for more than 24 hours. A little pattern matching (awk,perl) should get you the rest of the way. Man ps to understand what this is doing.&lt;BR /&gt;&lt;BR /&gt;I am not going to solve your problem (maybe I just ain't smart enough to figure out how to do it or maybe I figure that it's more important that you learn how to do it, you decide) but anyway I hope that nobody helps more than this either.&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Aug 2006 10:18:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836698#M272636</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-03T10:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: exporting date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836699#M272637</link>
      <description>If you have a script that displays all jobs that have been running for less than a day, your script must be stripping out older jobs to begin with. Take a look at the script and try to figure out where that is happening and modifying it to not do that.&lt;BR /&gt;&lt;BR /&gt;I am assuming "jobs" means "unix processes."</description>
      <pubDate>Thu, 03 Aug 2006 10:50:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836699#M272637</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-08-03T10:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: exporting date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836700#M272638</link>
      <description>$ ps -e -o comm,pid,etime&lt;BR /&gt;ps: illegal option -- o&lt;BR /&gt;usage: ps [-edaxzflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup] [-Z psetidlist]&lt;BR /&gt;&lt;BR /&gt;I understand you are trying to format the output, but the command flag -o just does not seem to work for me</description>
      <pubDate>Thu, 03 Aug 2006 13:57:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836700#M272638</guid>
      <dc:creator>Thom Cornwell</dc:creator>
      <dc:date>2006-08-03T13:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: exporting date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836701#M272639</link>
      <description>Thom,&lt;BR /&gt;&lt;BR /&gt;The UNIX95= is an important part of that command. It changes the behavior XPG4, which allows for different ps options and formatting.&lt;BR /&gt;&lt;BR /&gt;The man page for ps should have more information on it.</description>
      <pubDate>Thu, 03 Aug 2006 14:05:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836701#M272639</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-08-03T14:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: exporting date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836702#M272640</link>
      <description>I missed that part, I could see -o in the man page, but the command line thought I lost my beans.  Thanx</description>
      <pubDate>Thu, 03 Aug 2006 14:07:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836702#M272640</guid>
      <dc:creator>Thom Cornwell</dc:creator>
      <dc:date>2006-08-03T14:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: exporting date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836703#M272641</link>
      <description>The UNIX95=&lt;SPACE&gt;ps ... has the effect of defining the UNIX95 environment variable (as null but just so long as it's defined) for just that command. That triggers the XPG4 behavior of ps. If you have read through the man page down to the EXTERNAL INFLUENCES section, you would have figured this out for yourself ---- plus you wouldn't have made whoever wrote all the documentation stuff mad neither.&lt;BR /&gt;&lt;/SPACE&gt;</description>
      <pubDate>Thu, 03 Aug 2006 14:13:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/exporting-date-range/m-p/3836703#M272641</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-03T14:13:53Z</dc:date>
    </item>
  </channel>
</rss>

