3 Replies Latest reply: May 27, 2013 1:32 AM by ramkump12345 RSS

snap drive snapshots

Currently Being Moderated

Hi All


Does anyone know an easy way to create snapshots with the date and time with sdcli  something like below but this doesnt seem to work im using sdcli in a task script





  • Re: snap drive snapshots
    Currently Being Moderated


  • Re: snap drive snapshots
    Currently Being Moderated

    I use the below to snapshot volumes E: & F: and update their respective SnapMirrors


    @echo off
    cd \
    Echo Starting snapshot of Volumes
    cd "C:\Program Files\NetApp\SnapDrive"
    sdcli snap create -s %ComputerName%_SnapMirror_%date:~4,2%_%date:~7,2%_%date:~12,2%_%time:~0,2% -D e f -u yes

    REM the following describes the naming of the snap:
    REM %ComputerName% adds the computer name
    REM %date:~4,2% adds the day
    REM %date:~7,2% adds the month
    REM %date:~12,2 adds the Year
    REM %time:~0,2% adds the hour
    REM The resulting snapshot name should look like this: SERVERNAME_SnapMirror_11_12_12_10
    REM the "-D e f" triggers snaps on the listed volumes
    REM the "-u yes" triggers the snapmirror update
    REM Snapshot events can be viewed in the windows event viewer


    Now all I need to do is work out an efficient way to expire the snapshots before I run out of space.

    • Re: snap drive snapshots
      Currently Being Moderated

      I use the below which creates the hourly snapshots fine,



      Run the script below hourly to create crash consistent snapshots, I like you needed to delete old snaps so I created a snapshot autodelete policy on the volume to keep 20% free of the snapshot reserve free, im using a volume with 100% fractional reserve.

      @echo off

      for /f "tokens=1-3 delims=/- " %%a in ('date /t') do set XDate=%%c%%a%%b

      for /f "tokens=1-2 delims=: " %%a in ('time /t') do set XTime=%%a%%b

      rem echo %XDate%%XTime%

      sdcli snap create -s %computername%_%XDate%%XTime% -D e:\

      state                             : on
      commitment                 : try
      trigger                          : snap_reserve
      target_free_space        : 20%
      delete_order                : oldest_first
      defer_delete                 : user_created
      prefix                           : (not specified)
      destroy_list                   : none

More Like This

  • Retrieving data ...