<?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: How to rename file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754489#M656969</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You missed a space:&lt;BR /&gt;&lt;BR /&gt;# date+%m%d%Y&lt;BR /&gt;-bash: date+%m%d%Y: command not found&lt;BR /&gt;&lt;BR /&gt;# date +%m%d%Y&lt;BR /&gt;02182011&lt;BR /&gt;&lt;BR /&gt;So add the missing space and it will work!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sangilak</description>
    <pubDate>Fri, 18 Feb 2011 06:59:29 GMT</pubDate>
    <dc:creator>sangilak</dc:creator>
    <dc:date>2011-02-18T06:59:29Z</dc:date>
    <item>
      <title>How to rename file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754485#M656965</link>
      <description>Hi all,&lt;BR /&gt;I need to rename file to 'file_name_sysdate'. Because everyday one log file generates in the same directory and rewrites previous one. I need to have all of log files during 2-3 weeks. Log files cant be generated with unique name(pity but it's software feature). Always the same &lt;FILE_NAME.LOG&gt;&lt;BR /&gt;File generates once a day in midnight, and i want to rename this file in the morning to &lt;FILE_NAME_SYSDATE.LOG&gt;. Is it possible with script? &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Rustam&lt;/FILE_NAME_SYSDATE.LOG&gt;&lt;/FILE_NAME.LOG&gt;</description>
      <pubDate>Fri, 18 Feb 2011 04:22:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754485#M656965</guid>
      <dc:creator>rustam_2</dc:creator>
      <dc:date>2011-02-18T04:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754486#M656966</link>
      <description>Something like this in a script should do:&lt;BR /&gt;&lt;BR /&gt;mv file_name.log file_name_$(date +%m%d%Y).log&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This would yield a file with a name like file_name_02172011.log&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Feb 2011 04:48:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754486#M656966</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2011-02-18T04:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754487#M656967</link>
      <description>Hi Patrick,&lt;BR /&gt;&lt;BR /&gt;I couldnt run your syntax in bash environment. I run and got error:&lt;BR /&gt;&lt;BR /&gt;$ mv file_name.log file_name_$(date+%m%d%Y).log&lt;BR /&gt;-bash: date+%m%d%Y: command not found&lt;BR /&gt;&lt;BR /&gt;how can i explain to bash date+%m%d%Y?</description>
      <pubDate>Fri, 18 Feb 2011 05:15:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754487#M656967</guid>
      <dc:creator>rustam_2</dc:creator>
      <dc:date>2011-02-18T05:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754488#M656968</link>
      <description>Did you forgot the space in between date and + ? :-)&lt;BR /&gt;&lt;BR /&gt;date +%m%d%Y</description>
      <pubDate>Fri, 18 Feb 2011 06:56:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754488#M656968</guid>
      <dc:creator>Shrikant Lavhate</dc:creator>
      <dc:date>2011-02-18T06:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754489#M656969</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You missed a space:&lt;BR /&gt;&lt;BR /&gt;# date+%m%d%Y&lt;BR /&gt;-bash: date+%m%d%Y: command not found&lt;BR /&gt;&lt;BR /&gt;# date +%m%d%Y&lt;BR /&gt;02182011&lt;BR /&gt;&lt;BR /&gt;So add the missing space and it will work!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sangilak</description>
      <pubDate>Fri, 18 Feb 2011 06:59:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754489#M656969</guid>
      <dc:creator>sangilak</dc:creator>
      <dc:date>2011-02-18T06:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754490#M656970</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] file_name_$(date +%m%d%Y).log&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; This would yield a file with a name like&lt;BR /&gt;&amp;gt; file_name_02172011.log&lt;BR /&gt;&lt;BR /&gt;And if you use something like "_%Y-%m-%d"&lt;BR /&gt;instead, then you might get names which will&lt;BR /&gt;be easier to read and which will sort in the&lt;BR /&gt;normal order.&lt;BR /&gt;&lt;BR /&gt;Just a thought.</description>
      <pubDate>Fri, 18 Feb 2011 13:00:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754490#M656970</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-02-18T13:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754491#M656971</link>
      <description>Thanks for all of you. I hope i can set it in crontab file and run everyday automatically. &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Rustam</description>
      <pubDate>Mon, 21 Feb 2011 06:12:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754491#M656971</guid>
      <dc:creator>rustam_2</dc:creator>
      <dc:date>2011-02-21T06:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754492#M656972</link>
      <description>Hi Rustam,&lt;BR /&gt;&lt;BR /&gt;be aware, that the percent sign "%" has a special meaning in crontab entries, so it needs an esacpe character.&lt;BR /&gt;It may be &lt;BR /&gt;date +\%Y ...&lt;BR /&gt;or&lt;BR /&gt;date +%%Y ...&lt;BR /&gt;depending on the OS version you use - look at the man page.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Mon, 21 Feb 2011 07:57:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754492#M656972</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2011-02-21T07:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754493#M656973</link>
      <description>Hi Peter,&lt;BR /&gt;so if i want to use in crontab i must change my script to something like this?:&lt;BR /&gt;&lt;BR /&gt;mv my_file.log my_file_$(date +%%m%d%Y).log&lt;BR /&gt;&lt;BR /&gt;My OS version is 11.3&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;rustam</description>
      <pubDate>Mon, 21 Feb 2011 10:31:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754493#M656973</guid>
      <dc:creator>rustam_2</dc:creator>
      <dc:date>2011-02-21T10:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754494#M656974</link>
      <description>&amp;gt;if I want to use in crontab I must change my script to something like this?&lt;BR /&gt;&lt;BR /&gt;You must quote each %:&lt;BR /&gt;mv my_file.log my_file_$(date +\%m\%d\%Y).log</description>
      <pubDate>Mon, 21 Feb 2011 18:51:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754494#M656974</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-02-21T18:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754495#M656975</link>
      <description>Dennis,&lt;BR /&gt;this syntax worked for me via cron:&lt;BR /&gt;mv /u02/scripts/my_file.log /u02/scripts/my_file_$(date +%m%d%Y).log&lt;BR /&gt;&lt;BR /&gt;regards and thanks,&lt;BR /&gt;rustam</description>
      <pubDate>Fri, 25 Feb 2011 10:06:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754495#M656975</guid>
      <dc:creator>rustam_2</dc:creator>
      <dc:date>2011-02-25T10:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754496#M656976</link>
      <description>&amp;gt;this syntax worked for me via cron:&lt;BR /&gt;mv /u02/scripts/my_file.log /u02/scripts/my_file_$(date +%m%d%Y).log&lt;BR /&gt;&lt;BR /&gt;Yes your syntax will work in a script invoked FROM cron.  But if you have it in the crontab file itself, you need to quote each "%".</description>
      <pubDate>Fri, 25 Feb 2011 20:26:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-rename-file/m-p/4754496#M656976</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-02-25T20:26:12Z</dc:date>
    </item>
  </channel>
</rss>

