<?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: cron task in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566037#M227331</link>
    <description>You can continue a line as follows.&lt;BR /&gt;&lt;BR /&gt;xxxx ssjkjj skjjw;jw l;wk;kw \&lt;BR /&gt;sssjsj&lt;BR /&gt;&lt;BR /&gt;That counts as one line. Also it is a bad practice to do crontab -e. It is better to&lt;BR /&gt;do crontab -l "user_name" &amp;gt; /tmp/somefile.&lt;BR /&gt;&lt;BR /&gt;Modify /tmp/somefile.&lt;BR /&gt;&lt;BR /&gt;crontab /tmp/somefile&lt;BR /&gt;&lt;BR /&gt;Anil</description>
    <pubDate>Fri, 17 Jun 2005 09:18:39 GMT</pubDate>
    <dc:creator>RAC_1</dc:creator>
    <dc:date>2005-06-17T09:18:39Z</dc:date>
    <item>
      <title>cron task</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566036#M227330</link>
      <description>I want to submit task by crontab -e, when the command exceed one command line, I try to use % to expand the command to the next line. But doesn't work. Anyone can provide a sample cron file which has the command over one line.</description>
      <pubDate>Fri, 17 Jun 2005 09:11:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566036#M227330</guid>
      <dc:creator>mtang</dc:creator>
      <dc:date>2005-06-17T09:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: cron task</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566037#M227331</link>
      <description>You can continue a line as follows.&lt;BR /&gt;&lt;BR /&gt;xxxx ssjkjj skjjw;jw l;wk;kw \&lt;BR /&gt;sssjsj&lt;BR /&gt;&lt;BR /&gt;That counts as one line. Also it is a bad practice to do crontab -e. It is better to&lt;BR /&gt;do crontab -l "user_name" &amp;gt; /tmp/somefile.&lt;BR /&gt;&lt;BR /&gt;Modify /tmp/somefile.&lt;BR /&gt;&lt;BR /&gt;crontab /tmp/somefile&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Fri, 17 Jun 2005 09:18:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566037#M227331</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-06-17T09:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: cron task</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566038#M227332</link>
      <description>Not sure if you can do it, but even if you could I wouldn't.&lt;BR /&gt;&lt;BR /&gt;If you need complicated scripting, put it in a separate script and call that.&lt;BR /&gt;&lt;BR /&gt;If you just need to run a few commands and capture their output together use something like:&lt;BR /&gt;&lt;BR /&gt;* * * * * ( command1 ; command2 ; command3 ) &amp;gt; logfile 2&amp;gt;&amp;amp;1</description>
      <pubDate>Fri, 17 Jun 2005 09:18:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566038#M227332</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2005-06-17T09:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: cron task</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566039#M227333</link>
      <description>RAC's suggestion of placing a backslash (\) where you want to break the command across lines works fine. I have used with several commands in the past with no problem.</description>
      <pubDate>Fri, 17 Jun 2005 09:30:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566039#M227333</guid>
      <dc:creator>DCE</dc:creator>
      <dc:date>2005-06-17T09:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: cron task</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566040#M227334</link>
      <description>Percent character (%) is crontab is used as follows&lt;BR /&gt;&lt;BR /&gt;* * * * * /usr/bin/mailx -s test &lt;USER&gt;%hello world&lt;BR /&gt;&lt;BR /&gt;is the same as&lt;BR /&gt;&lt;BR /&gt;* * * * * echo "hello world" | /usr/bin/mailx -s test &lt;USER&gt;&lt;BR /&gt;&lt;BR /&gt;So all text up to % in the command field is executed by the shell. The rest (after %) is provided as standard input for the command that appears before %.&lt;/USER&gt;&lt;/USER&gt;</description>
      <pubDate>Sat, 18 Jun 2005 02:40:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566040#M227334</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2005-06-18T02:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: cron task</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566041#M227335</link>
      <description>cron (like the shell and virtually all Unix commands) do not care about the line length. What you see on your screen in vi is artificially folded by the terminal as well as vi. You can type a command that is thousands of characters long (make sure the option for wrapmargin is 0 or vi will automatically break long lines into separate lines. But no problem: just put the cursor on the first line and type J (capital J) and it will join the next line to the current line. Repeat as need for one long line.  To see that it is all one line, type $ and the cursor will jump to the end of the line (which might several terminal lines down the page).&lt;BR /&gt; &lt;BR /&gt;(to turn off wrapmargin, type the command :set wm=0</description>
      <pubDate>Sat, 18 Jun 2005 22:32:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566041#M227335</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-06-18T22:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: cron task</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566042#M227336</link>
      <description>Hi,&lt;BR /&gt;I have just tried. It is taking as one line only. I have typed without giving "enter" in between. I don't know is it because WM mentioned by Bill is set by default in my terminal as I am using reflection to connect to all the servers. So you need not to use different charecters to make it one line.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Jino&lt;BR /&gt;</description>
      <pubDate>Sun, 19 Jun 2005 22:17:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566042#M227336</guid>
      <dc:creator>Jino.P.V</dc:creator>
      <dc:date>2005-06-19T22:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: cron task</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566043#M227337</link>
      <description>You can check on all your settings in vi with the ex commend:&lt;BR /&gt; &lt;BR /&gt;:set&lt;BR /&gt;autoindent autowrite ignorecase redraw report=1 shell=/sbin/sh showmode term=70092 nowrapscan wrapmargin=2  &lt;BR /&gt; &lt;BR /&gt;In my case, the automatic line split occurs when typing a new line and I reach the last 2 columns. An existing long line is not split automatically by vi. Set wrapmargin (or wm, the abbreviation) to zero and you'll get long lines by default. To make this permanent for your shell, edit .exrc in your home directory to add this line at the top:&lt;BR /&gt; &lt;BR /&gt;set nowrapsearch ignorecase autoindent autowrite wrapmargin=0 sh=/usr/bin/sh report=1 showmode&lt;BR /&gt; &lt;BR /&gt;Now if you don't have a .exrc file, just create it with this above line. If you already have one, just adjust the existing set line similar to above. I have several useful options in the above example. The () parens show the abbreviation you can use for the same setting. All of these can be set inside vi for the current session using :set&lt;BR /&gt; &lt;BR /&gt;nowrapsearch (nows) stops vi from silently wrapping around the file when searching.&lt;BR /&gt; &lt;BR /&gt;ignorecase (ic) makes searches case-insensitive&lt;BR /&gt; &lt;BR /&gt;autoindent (ai) will automatically follow your indentation. Each new line starts directly below the previous line including and leading spaces. To back up or get back to the beginning of the line, type CTRL-d to backup 1 tab distance.&lt;BR /&gt; &lt;BR /&gt;autowrite (aw) will post the current changes to the original file when you escape to a shell (ie, :!sh)&lt;BR /&gt; &lt;BR /&gt;wrapmargin=0 (wm=0) says to not split new lines when they are within XX columns of the end of the margin. NOTE: wm=72 means split lines starting 72 columns BEFORE the right edge, not column 72. This setting allows the wm setting to vary based on the width of the terminal.&lt;BR /&gt; &lt;BR /&gt;sh=/usr/bin/sh sets the shell to use. If not set, the SHELL variable is used.&lt;BR /&gt; &lt;BR /&gt;report=1 sets the number of lines that must be changed by a command before a report line is displayed (ie, 12 lines deleted) at the bottom left of the screen.&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;showmode (smd) sets the tag message at the bottom right of your vi screen to show REPLACE or INPUT when vi is not in the command mode.&lt;BR /&gt; &lt;BR /&gt;All these (and many more) settings are defined in the man page for ex (not vi). Vi is actually several editors in one. All : commands (like :!sh or :%d or :set) are run byy the ex editor.</description>
      <pubDate>Mon, 20 Jun 2005 08:34:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566043#M227337</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-06-20T08:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: cron task</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566044#M227338</link>
      <description>To make your crontab more "readable" I would put long commands in a script instead...then call the script from cron.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;#defrag filesystems&lt;BR /&gt;0 22 * * 4 /usr/local/bin/fsadm.defrag &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# cat /usr/local/bin/fsadm.defrag&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# defrag all mounted file systems&lt;BR /&gt;LOG=/tmp/fsadm.defrag.log&lt;BR /&gt;if [ -f $LOG ]&lt;BR /&gt;then&lt;BR /&gt;        mv $LOG $LOG.old&lt;BR /&gt;fi&lt;BR /&gt;cat /dev/null &amp;gt; $LOG&lt;BR /&gt;&lt;BR /&gt;for i in `mount -l | grep -v stand |awk '{print $1}'`&lt;BR /&gt;do&lt;BR /&gt;echo "defraging " $i &amp;gt;&amp;gt; $LOG&lt;BR /&gt;fsadm -F vxfs -d -D -e -E $i &amp;gt;&amp;gt; $LOG&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It would be ugly to put that all on a single command line...&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jun 2005 08:56:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566044#M227338</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-06-20T08:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: cron task</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566045#M227339</link>
      <description>Geoff wrote...&lt;BR /&gt; &lt;BR /&gt;&amp;gt;&amp;gt; for i in `mount -l | grep -v stand |awk '{print $1}'`&lt;BR /&gt; &lt;BR /&gt;mount -l shows local filesystems but will return vxfs (desired), hfs (not applicable) and cdfs (not applicable). If you change the command to something like this, it will work for all systems:&lt;BR /&gt; &lt;BR /&gt;for i in $(bdf -t vxfs | grep -v %used |awk '{print $1}')&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jun 2005 09:18:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566045#M227339</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-06-20T09:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: cron task</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566046#M227340</link>
      <description>Bill - pretty cool - except that bdf doesn't format nicely - when filesystems or mount points have long names:&lt;BR /&gt;&lt;BR /&gt;# bdf -t vxfs | grep -v %used |awk '{print $1}'&lt;BR /&gt;/dev/vg00/lvol3&lt;BR /&gt;/dev/vg00/lvol8&lt;BR /&gt;/dev/vg48/lvsw&lt;BR /&gt;/dev/vg48/lvoraclesw&lt;BR /&gt;20971520&lt;BR /&gt;/dev/vg48/lvmiscsw&lt;BR /&gt;/dev/vg48/lvibmsw&lt;BR /&gt;/dev/vg48/lvhpsw&lt;BR /&gt;/dev/vg48/lvemcsw&lt;BR /&gt;/dev/vg46/lvol1&lt;BR /&gt;/dev/vg46/lvol2&lt;BR /&gt;/dev/vg00/lvol9&lt;BR /&gt;/dev/vg00/lvol7&lt;BR /&gt;/dev/vg47/lvol1&lt;BR /&gt;/dev/vg00/lvol6&lt;BR /&gt;/dev/vg14/lvol2&lt;BR /&gt;/dev/vg14/lvol5&lt;BR /&gt;/dev/vg14/lvol11&lt;BR /&gt;/dev/vg14/lvol1&lt;BR /&gt;/dev/vg14/lvol6&lt;BR /&gt;/dev/vg14/lvol3&lt;BR /&gt;/dev/vg14/lvol4&lt;BR /&gt;/dev/vg14/lvol10&lt;BR /&gt;/dev/vg00/lvol5&lt;BR /&gt;/dev/vg47/lvol2&lt;BR /&gt;/dev/vg00/lvol4&lt;BR /&gt;/dev/vg14/lvol7&lt;BR /&gt;&lt;BR /&gt;Maybe use the bdfmegs script?&lt;BR /&gt;&lt;BR /&gt;# bdfmegs vxfs | grep -v File |awk '{print $1}'&lt;BR /&gt;/dev/vg00/lvol3&lt;BR /&gt;/dev/vg00/lvol1&lt;BR /&gt;/dev/vg00/lvol8&lt;BR /&gt;/dev/vg48/lvsw&lt;BR /&gt;/dev/vg48/lvoraclesw&lt;BR /&gt;/dev/vg48/lvmiscsw&lt;BR /&gt;/dev/vg48/lvibmsw&lt;BR /&gt;/dev/vg48/lvhpsw&lt;BR /&gt;/dev/vg48/lvemcsw&lt;BR /&gt;/dev/vg46/lvol1&lt;BR /&gt;/dev/vg46/lvol2&lt;BR /&gt;/dev/vg00/lvol9&lt;BR /&gt;/dev/vg00/lvol7&lt;BR /&gt;/dev/vg47/lvol1&lt;BR /&gt;/dev/vg00/lvol6&lt;BR /&gt;/dev/vg14/lvol2&lt;BR /&gt;/dev/vg14/lvol5&lt;BR /&gt;/dev/vg14/lvol11&lt;BR /&gt;/dev/vg14/lvol1&lt;BR /&gt;/dev/vg14/lvol6&lt;BR /&gt;/dev/vg14/lvol3&lt;BR /&gt;/dev/vg14/lvol4&lt;BR /&gt;/dev/vg14/lvol10&lt;BR /&gt;/dev/vg00/lvol5&lt;BR /&gt;/dev/vg47/lvol2&lt;BR /&gt;/dev/vg00/lvol4&lt;BR /&gt;/dev/vg14/lvol7&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jun 2005 10:13:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-task/m-p/3566046#M227340</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-06-20T10:13:01Z</dc:date>
    </item>
  </channel>
</rss>

