Drive Snapshot

Discussion in 'backup, imaging & disk mgmt' started by Hadron, Nov 11, 2019.

  1. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,115
    Location:
    NSW, Australia
    Yes, never six.
     
  2. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,137
    Thank you, Brian.
    Snapshot is now fully automated.
    It's a nice little backup program.
     
  3. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,115
    Location:
    NSW, Australia
    You could schedule that batch file in your wife's computer, come back in a few months and the correct number of backups will be present.
     
  4. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,137
    I will be. :thumb:
     
  5. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,137
    This is working well, Brian.
    It's amazing how powerful a 450 KB executable is.

    That's a massive difference in size to many other backup applications. And it's so portable.
     
  6. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,115
    Location:
    NSW, Australia
    Ghost2003.exe was 1 MB but not a patch on DS.

    IFD is 700 KB but it doesn't run in Windows.
     
  7. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,137
    Thanks again, Brian.
    You have found the answer again.

    Well done. A small 450 KB application is superior than huge swollen applications that gets their claws into your system.
    Drive Snapshot is a perfect example of that. *puppy*
     
  8. EASTER

    EASTER Registered Member

    Joined:
    Jul 28, 2007
    Posts:
    11,126
    Location:
    U.S.A. (South)
    Couldn't agree more on that @Hadron
    I been using DS since Windows 98 and onward into XP and this tiny Kb backup and imaging program is nothing short of rock solid. I have still yet to experience a single failure, not a one, on restoring images with it. For this camp that speaks volumes.

    This and Macrium are my 2 Go-To imaging apps and still are for eons it seems.
     
  9. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,137
    Yes, EASTER.
    And now DS is fully automated with the script @Brian K developed.
     
  10. EASTER

    EASTER Registered Member

    Joined:
    Jul 28, 2007
    Posts:
    11,126
    Location:
    U.S.A. (South)
    Exactly! :thumb:

    Appreciate the raising interest about this program again. With so much always going on it's so cool to test @Brian K scripts and discover more branches of the command lines that fit given situations for our good machines!
     
  11. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,137
    Nice one, Brian.
    This is working great.

    I just had a little typo in my purge, retain 5 script. Line 2. :eek:
     
  12. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,115
    Location:
    NSW, Australia
    I missed that one. I'm glad it was your typo and not mine.
     
  13. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,137
    Yes, it was mine.
    I messed it up adding another line. :eek:
     
  14. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,137
    @Brian K shared with me a great retention and purge script that allows you to decide how many backups you wish to keep before the oldest one is purged (deleted). Each backup has its own sub-folder.
    I have then created a schedule in Task Scheduler.
    It is fully automated.

    If you wish, you can then place a shortcut of that schedule on the Desktop to run whenever you like.

    After numerous changes, this is the DS script I settled with an am still using today. The script and snapshot64.exe needs to be in the same folder.
    The paths are all that would need to be changed to suit your own backup locations.
    The code can be altered to change the number of backups to retain. The one below retains 5 backups.

    The code at the bottom is an example of retaining 6 backups.
    The image at the bottom are my 5 backup folders.

    Code:
    @echo off
    CD /d %~dp0
    if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\$disk-$date-$hour-$minute-$second.sna" -o -L0 --UseVSS -W
    
    CD /d D:\System_Backup\Drive_Snapshot
    
    MD Backup
    MOVE *.sna Backup
    
    IF EXIST Entire-5 (RD Entire-5 /s /q)
    IF EXIST Entire-4 (REN Entire-4 Entire-5)
    IF EXIST Entire-3 (REN Entire-3 Entire-4)
    IF EXIST Entire-2 (REN Entire-2 Entire-3)
    IF EXIST Entire-1 (REN Entire-1 Entire-2)
    REN Backup Entire-1
    Code:
    IF EXIST Entire-6 (RD Entire-6 /s /q)
    IF EXIST Entire-5 (REN Entire-5 Entire-6)
    IF EXIST Entire-4 (REN Entire-4 Entire-5)
    IF EXIST Entire-3 (REN Entire-3 Entire-4)
    IF EXIST Entire-2 (REN Entire-2 Entire-3)
    IF EXIST Entire-1 (REN Entire-1 Entire-2)
    REN Backup Entire-1
    Drive Snapshot Script Folders.jpg

    Thanks again, Brian. :thumb:
     
    Last edited: Jul 12, 2020
  15. paulderdash

    paulderdash Registered Member

    Joined:
    Dec 27, 2013
    Posts:
    4,639
    Location:
    Under a bushel ...
    Only now belatedly found this thread! But haven't read right through it yet ...

    Have been thinking of trying DS again, and this script would definitely tempt me.

    I did look at it before because it has such good reviews, but became a little confused ...

    Q: Hadron, would this backup my entire drive, or just the system partition(s)? On one laptop I have data on a separate D: partition (same drive).
    And restore - easy enough? OK, I'm lazy ... :D
     
  16. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,137
    Hi Paul...
    I like things easy too.

    Yes, you can backup your entire drive.
    I always backup my entire drive no mater what application I use.

    For restoration, there are numerous options.
    Because it is a standalone application, it can use any bootable media.
     
    Last edited: Jul 12, 2020
  17. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,115
    Location:
    NSW, Australia
    For an Entire Drive backup...

    Code:
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\$disk-$date-$hour-$minute-$second.sna" -R -o -L0 --UseVSS -W
    For a multi-partition backup...

    Code:
    snapshot64.exe HD1:1+HD1:2+HD1:4 "D:\System_Backup\Drive_Snapshot\$disk-$date-$hour-$minute-$second.sna" -R -o -L0 --UseVSS -W
     
    Last edited: Jul 12, 2020
  18. EASTER

    EASTER Registered Member

    Joined:
    Jul 28, 2007
    Posts:
    11,126
    Location:
    U.S.A. (South)
    :thumb: The command lines for DS is really provided nifty options and it had been the subject of much detail over the past seasons in the sun.

    Thanks for your contributions to the matter @Brian K
     
  19. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,137
  20. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,115
    Location:
    NSW, Australia
    When diffs are created by a DS script you can't have a full and diff filename of...

    $disk-$date-$hour-$minute-$second.sna

    ...because the timestamp of the diff is not compatible with the timestamp of the full image. The diff can't find the full.

    Using $disk.sna is fine. You can make multiple differential images on subsequent days. From a scheduled task or manually.
     
  21. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,137
    I have not tried the differential -h switch.
     
  22. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,115
    Location:
    NSW, Australia
    Hadron, can you try these? Make a new Full from the script below, then multiple Diffs. All files will be in Entire-1. Diffs will be in their own dated sub-folders of Entire-1.

    Full...
    Code:
    @echo off
    CD /d %~dp0
    if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\$disk.sna" -R -L0 --UseVSS -W
    
    CD /d D:\System_Backup\Drive_Snapshot
    
    MD Backup
    MOVE *.sna Backup
    MOVE *.hsh Backup
    
    IF EXIST Entire-5 (RD Entire-5 /s /q)
    IF EXIST Entire-4 (REN Entire-4 Entire-5)
    IF EXIST Entire-3 (REN Entire-3 Entire-4)
    IF EXIST Entire-2 (REN Entire-2 Entire-3)
    IF EXIST Entire-1 (REN Entire-1 Entire-2)
    REN Backup Entire-1
    Differential...
    Code:
    @echo off
    CD /d %~dp0
    if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\Entire-1\$disk-diff.sna" -h"D:\System_Backup\Drive_Snapshot\Entire-1\$disk.hsh" -R -L0 --UseVSS -W
    
    CD /d D:\System_Backup\Drive_Snapshot\Entire-1
    
    :: +++++++++  Move diff .sna files to another folder  +++++++++
    set hh=%time:~0,2%
    if "%time:~0,1%"==" " set hh=0%hh:~1,1%
    set timestamp=%time:~0,8%
    if @%timestamp:~0,1% == @ set timestamp=0%timestamp:~1,7%
    set timestamp=%date:.=%_%timestamp::=%
    echo.Timestamp :: %timestamp%
    MD %timestamp%
    MOVE *diff.sna %timestamp%
     
    Last edited: Jul 13, 2020
  23. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,115
    Location:
    NSW, Australia
    The Short Date format in Control Panel, Region, should use - and not /
    Otherwise %timestamp% won't work.

    I know Hadron uses this.

    I hope my edits match your computer folders.
     
    Last edited: Jul 13, 2020
  24. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,115
    Location:
    NSW, Australia
    Here is another Diff script. I prefer this one as there are no sub-folder in Entire-1. All files are in Entire-1. This makes the restore easier.

    Code:
    @echo off
    CD /d %~dp0
    if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\Entire-1\$disk-diff.sna" -h"D:\System_Backup\Drive_Snapshot\Entire-1\$disk.hsh" -R -L0 --UseVSS -W
    
    CD /d D:\System_Backup\Drive_Snapshot\Entire-1
    
    :: +++++++++  Move diff .sna files to another folder  +++++++++
    set hh=%time:~0,2%
    if "%time:~0,1%"==" " set hh=0%hh:~1,1%
    set timestamp=%time:~0,8%
    if @%timestamp:~0,1% == @ set timestamp=0%timestamp:~1,7%
    set timestamp=%date:.=%_%timestamp::=%
    echo.Timestamp :: %timestamp%
    REN *diff.sna *diff-%timestamp%.sna
     
  25. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,115
    Location:
    NSW, Australia
    Forget the above script. #124. It makes nice diffs but they can't be restored because of the changed diff filename.
     
    Last edited: Jul 13, 2020
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.