Alternating device by month

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fourt46
    PCHF Member
    • Sep 2021
    • 1

    #1

    Alternating device by month

    Looking for suggestions for a script to alternate between two hot water tanks by odd & even months?

    Cheers
  • Bruce
    PCHF Moderator
    • Oct 2017
    • 10702

    #2
    i wrote this years ago for my backups.

    for /f %%a in (β€˜wmic os get localdatetime ^| find β€œ.”’) do set dte=%%a
    set mth=%dte:~4,2%
    for %%a in (01 05 09) do if β€œ%mth%”==β€œ%%a” set job=1
    for %%a in (02 06 10) do if β€œ%mth%”==β€œ%%a” set job=2
    for %%a in (03 07 11) do if β€œ%mth%”==β€œ%%a” set job=3
    for %%a in (04 08 12) do if β€œ%mth%”==β€œ%%a” set job=4

    echo Month is %mth%
    echo Backup Set is %job%

    put it in a .bat file, and with a little modification, you should be good.

    Comment

    Working...