<?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: Backups on weekly basis in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698872#M248985</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Here's a simple perl script. You can adapt it to your rules as needed.  The script returns a three-item string denoting the day-of-the-week (1-7 where 1=Monday), the number of the week within the month (1-5) and the week-number (1-53) of the year.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use Date::Calc qw( Decode_Date_US Day_of_Week Week_of_Year );&lt;BR /&gt;die "Usage: $0 MMDDYYYY\n" unless @ARGV;&lt;BR /&gt;my ($year, $month, $day);&lt;BR /&gt;if (($year, $month, $day) = Decode_Date_US($ARGV[0])) {&lt;BR /&gt;print Day_of_Week ($year, $month, $day), " ",&lt;BR /&gt;int (($day + Day_of_Week ($year, $month, 1) - 2) / 7) + 1, " ",&lt;BR /&gt;scalar Week_of_Year($year, $month, $day), "\n";&lt;BR /&gt;}&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;Run the script by passing a US-format (MMDDYYYY) date either with or without delimiters:&lt;BR /&gt;&lt;BR /&gt;# ./daynums 01/01/2005&lt;BR /&gt;6 1 53&lt;BR /&gt;&lt;BR /&gt;...since 01/01/2005 was a Saturday (6) in the first (1) week of January but is reckoned as the LAST (53rd) week of the preceeding year, since no Monday had yet occured in 2005.&lt;BR /&gt;&lt;BR /&gt;# ./daynums 12/28/2005&lt;BR /&gt;3 5 52&lt;BR /&gt;&lt;BR /&gt;...a Wednesday (day-3) of the fifth (5) week of the month and the 52nd week of the year.&lt;BR /&gt;&lt;BR /&gt;If you would prefer to work and think in European rathter than US formats, substitute "_EU" for "_US" and change the line beginning with "die" thusly:&lt;BR /&gt;&lt;BR /&gt;use Date::Calc qw( Decode_Date_EU Day_of_Week Week_of_Year );&lt;BR /&gt;die "Usage: $0 DDMMYYYY\n" unless @ARGV;&lt;BR /&gt;my  ($year, $month, $day);&lt;BR /&gt;if (($year, $month, $day) = Decode_Date_EU($ARGV[0])) {&lt;BR /&gt;&lt;BR /&gt;Then for December 28, 2005 you would do:&lt;BR /&gt;&lt;BR /&gt;# ./daynums 28/12/2005&lt;BR /&gt;3 5 52&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Wed, 28 Dec 2005 16:47:10 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2005-12-28T16:47:10Z</dc:date>
    <item>
      <title>Backups on weekly basis</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698868#M248981</link>
      <description>Hi &lt;BR /&gt;I am looking forward to create  a script where system should sugest me the tape number.&lt;BR /&gt;For eg I have 12 tapes .&lt;BR /&gt;&lt;BR /&gt;1) Saturday to Wednesday = 5 tapes (TNO1 to TNO5)&lt;BR /&gt;2) Weekly backup tape = 1st Thursday(TNO6)&lt;BR /&gt;3) 2nd Saturday to 2nd Wednesday = 5 tapes(TNO7 to TNO11)&lt;BR /&gt;4)Weekly backup tape = 2nd Thursday(TNO12)&lt;BR /&gt;&lt;BR /&gt;and backup to step 1&lt;BR /&gt;&lt;BR /&gt;I Guess it can be done on weeks count&lt;BR /&gt; Like We have 52 weeks&lt;BR /&gt;&lt;BR /&gt;1st week it should ask me &lt;BR /&gt;Saturday to Wednesday = 5 tapes (TNO1 to TNO5)&lt;BR /&gt;&lt;BR /&gt;and 2nd week &lt;BR /&gt;2nd Saturday to 2nd Wednesday = 5 tapes(TNO7 to TNO11)&lt;BR /&gt;&lt;BR /&gt;With EVEN and ODD combination&lt;BR /&gt;&lt;BR /&gt;But i dont know how best i can write it in script.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Musaddaq&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Dec 2005 02:58:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698868#M248981</guid>
      <dc:creator>musaddaq_2</dc:creator>
      <dc:date>2005-12-28T02:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Backups on weekly basis</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698869#M248982</link>
      <description>hi Musaddaq,&lt;BR /&gt;&lt;BR /&gt;did you have a look at Data Protector?&lt;BR /&gt;&lt;BR /&gt;this software make these tasks simple for you.&lt;BR /&gt;&lt;BR /&gt;hope this helps&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 28 Dec 2005 03:05:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698869#M248982</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2005-12-28T03:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Backups on weekly basis</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698870#M248983</link>
      <description>Hi Musaddaq ,&lt;BR /&gt;&lt;BR /&gt;Dataprotector:&lt;BR /&gt;A scalable data management solution that automates high performance backup and recovery, from disk or tape, over unlimited distances, ensuring 24x7 business operations and maximized IT resources.&lt;BR /&gt;&lt;BR /&gt;You can check this page for details:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h18006.www1.hp.com/products/storage/software/dataprotector/" target="_blank"&gt;http://h18006.www1.hp.com/products/storage/software/dataprotector/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Dec 2005 03:10:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698870#M248983</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2005-12-28T03:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Backups on weekly basis</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698871#M248984</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;A script can be written,&lt;BR /&gt;&lt;BR /&gt;all you have to do it to check a file.&lt;BR /&gt;&lt;BR /&gt;E.g &lt;BR /&gt;&lt;BR /&gt;DAT.NUM will be increamented each time&lt;BR /&gt;&lt;BR /&gt;The File DAT.NUM will have just&lt;BR /&gt;DAT01&lt;BR /&gt;&lt;BR /&gt;once that backup is complete it will be&lt;BR /&gt;DAT02 &lt;BR /&gt;&lt;BR /&gt;ensure that your scripts changes each time and at 12th run puts to DAT01.&lt;BR /&gt;&lt;BR /&gt;Else use dataprotector&lt;BR /&gt;&lt;BR /&gt;007</description>
      <pubDate>Wed, 28 Dec 2005 09:57:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698871#M248984</guid>
      <dc:creator>Chan 007</dc:creator>
      <dc:date>2005-12-28T09:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Backups on weekly basis</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698872#M248985</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Here's a simple perl script. You can adapt it to your rules as needed.  The script returns a three-item string denoting the day-of-the-week (1-7 where 1=Monday), the number of the week within the month (1-5) and the week-number (1-53) of the year.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use Date::Calc qw( Decode_Date_US Day_of_Week Week_of_Year );&lt;BR /&gt;die "Usage: $0 MMDDYYYY\n" unless @ARGV;&lt;BR /&gt;my ($year, $month, $day);&lt;BR /&gt;if (($year, $month, $day) = Decode_Date_US($ARGV[0])) {&lt;BR /&gt;print Day_of_Week ($year, $month, $day), " ",&lt;BR /&gt;int (($day + Day_of_Week ($year, $month, 1) - 2) / 7) + 1, " ",&lt;BR /&gt;scalar Week_of_Year($year, $month, $day), "\n";&lt;BR /&gt;}&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;Run the script by passing a US-format (MMDDYYYY) date either with or without delimiters:&lt;BR /&gt;&lt;BR /&gt;# ./daynums 01/01/2005&lt;BR /&gt;6 1 53&lt;BR /&gt;&lt;BR /&gt;...since 01/01/2005 was a Saturday (6) in the first (1) week of January but is reckoned as the LAST (53rd) week of the preceeding year, since no Monday had yet occured in 2005.&lt;BR /&gt;&lt;BR /&gt;# ./daynums 12/28/2005&lt;BR /&gt;3 5 52&lt;BR /&gt;&lt;BR /&gt;...a Wednesday (day-3) of the fifth (5) week of the month and the 52nd week of the year.&lt;BR /&gt;&lt;BR /&gt;If you would prefer to work and think in European rathter than US formats, substitute "_EU" for "_US" and change the line beginning with "die" thusly:&lt;BR /&gt;&lt;BR /&gt;use Date::Calc qw( Decode_Date_EU Day_of_Week Week_of_Year );&lt;BR /&gt;die "Usage: $0 DDMMYYYY\n" unless @ARGV;&lt;BR /&gt;my  ($year, $month, $day);&lt;BR /&gt;if (($year, $month, $day) = Decode_Date_EU($ARGV[0])) {&lt;BR /&gt;&lt;BR /&gt;Then for December 28, 2005 you would do:&lt;BR /&gt;&lt;BR /&gt;# ./daynums 28/12/2005&lt;BR /&gt;3 5 52&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 28 Dec 2005 16:47:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698872#M248985</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-12-28T16:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Backups on weekly basis</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698873#M248986</link>
      <description>Thnaks A lot Guys&lt;BR /&gt;I will try making the script from your suggestions and will get back to you.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Musaddaq</description>
      <pubDate>Thu, 29 Dec 2005 00:26:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698873#M248986</guid>
      <dc:creator>musaddaq_2</dc:creator>
      <dc:date>2005-12-29T00:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Backups on weekly basis</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698874#M248987</link>
      <description>You can select device number with this script as,&lt;BR /&gt;&lt;BR /&gt;# cat device.sh&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;if [[ `expr $(date +'%W') % 2` -ne 0 ]]&lt;BR /&gt;then&lt;BR /&gt;  if [[ $(date +'%a') = "Sat" ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Tape Device = TN01"&lt;BR /&gt;  elif [[ $(date +'%a') = "Sun" ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Tape Device = TN02"&lt;BR /&gt;  elif [[ $(date +'%a') = "Mon" ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Tape Device = TN03"&lt;BR /&gt;  elif [[ $(date +'%a') = "Tue" ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Tape Device = TN04"&lt;BR /&gt;  elif [[ $(date +'%a') = "Wed" ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Tape Device = TN05"&lt;BR /&gt;  elif [[ $(date +'%a') = "Thu" ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Tape Device = TN06"&lt;BR /&gt;  fi&lt;BR /&gt;else&lt;BR /&gt;  if [[ $(date +'%a') = "Sat" ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Tape Device = TN07"&lt;BR /&gt;  elif [[ $(date +'%a') = "Sun" ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Tape Device = TN08"&lt;BR /&gt;  elif [[ $(date +'%a') = "Mon" ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Tape Device = TN09"&lt;BR /&gt;  elif [[ $(date +'%a') = "Tue" ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Tape Device = TN10"&lt;BR /&gt;  elif [[ $(date +'%a') = "Wed" ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Tape Device = TN11"&lt;BR /&gt;  elif [[ $(date +'%a') = "Thu" ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Tape Device = TN12"&lt;BR /&gt;  fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# END&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;########################&lt;BR /&gt;&lt;BR /&gt;If you execute this every day, it will work based on date command.&lt;BR /&gt;&lt;BR /&gt;-Muthu</description>
      <pubDate>Thu, 29 Dec 2005 02:51:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backups-on-weekly-basis/m-p/3698874#M248987</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-12-29T02:51:27Z</dc:date>
    </item>
  </channel>
</rss>

