New Drive Snapshot build released.

Discussion in 'backup, imaging & disk mgmt' started by Aaron Here, Dec 10, 2010.

  1. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,174
    Location:
    NSW, Australia
    I changed
    Code:
    @echo off
    to
    Code:
    ::@echo off
    and now the batch file closes.

    Try this...

    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:\SystemBackup\Drive_Snapshot\$DISK-$DATE.sna" -o -L0 --UseVSS --LogFile:D:\SystemBackup\Drive_Snapshot\LOGFILE.TXT
    exit
     
  2. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,174
    Location:
    NSW, Australia
    This is interesting. It should put each .sna set into a date/time folder. So you could do multiple backups in the one day without risk of over-writing. My folder is named
    2019-Apr-25_221457

    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:\SystemBackup\Drive_Snapshot\$DISK-$DATE.sna" -o -L0 --UseVSS --LogFile:D:\SystemBackup\Drive_Snapshot\LOGFILE.TXT
    
    CD /d D:\SystemBackup\Drive_Snapshot
    
    :: +++++++++  Move all .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 *.sna %timestamp%
    
    exit
    
    See #1256. You can have yyyy MMM MM dd (Short date) in any order but you must have - not /
     
    Last edited: Apr 25, 2019
  3. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    Thanks for them, Brian.
    Very handy. :thumb:
     
  4. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    What is _221457 ? 10:14:57 PM?
     
  5. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,174
    Location:
    NSW, Australia
    Hadron,

    I'm very happy with the last batch file. It gets around the potential issue of over-writing .sna files.

    Yes, 24 hour clock format. Don't worry if your computer clock is in AM/PM as the script still works. The script works for MBR and UEFI systems and the Entire Disk backup does restore successfully.

    When you first run the batch file, all .sna files will be moved to a new folder but subsequent runs will only have one .sna set per folder. LOGFILE.TXT is a running log of all your backups so you don't have to watch the Command Window.

    I don't understand why...
    Code:
    @echo off
    ...prevented DS from closing.
     
    Last edited: Apr 25, 2019
  6. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,174
    Location:
    NSW, Australia
    These are my regional settings showing - and not / in the Short date format.

    date.png time.png
     
  7. EASTER

    EASTER Registered Member

    Joined:
    Jul 28, 2007
    Posts:
    11,126
    Location:
    U.S.A. (South)
    Taking very useful notes. Productive marathon discussion on DS basics. And automation methods
     
  8. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,174
    Location:
    NSW, Australia
    This is the same script but edited so you and others can more easily enter their paths. Only edit the first 3 "set" lines.

    Code:
    ::@echo off
    CD /d %~dp0
    if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    
    set HDnum=HD1
    set DSpath=D:\SystemBackup\Drive_Snapshot
    set logpath=D:\SystemBackup\Drive_Snapshot
    
    snapshot64.exe %HDnum%:* "%DSpath%\$DISK-$DATE.sna" -o -L0 --UseVSS --LogFile:"%logpath%\LOGFILE.TXT"
    
    CD /d "%DSpath%"
    set HDnum=
    set DSpath=
    set logpath=
    
    :: +++++++++  Move all .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 *.sna %timestamp%
    
    exit
    I use -R but you don't.
     
    Last edited: Apr 25, 2019
  9. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,174
    Location:
    NSW, Australia
    For non Hadron people who would like to create an Entire Disk backup with this script. Open DS and determine which disk will be backed up. It is usually HD1 but not always. My test computer has a NVMe SSD (contains the OS) and this is seen as HD5. Close DS.
    Then fill in the first 3 "set" lines of your batch file. The logpath and DSpath don't have to be the same.
    Right click the batch file and Run as Admin. The Command Window is minimized to the Task Bar but you can bring it up if you desire.
     
    Last edited: Apr 25, 2019
  10. EASTER

    EASTER Registered Member

    Joined:
    Jul 28, 2007
    Posts:
    11,126
    Location:
    U.S.A. (South)
    Thanks @Brian K for the timely and useful recommendation on that. This recent new discussion on DS and it's sometimes seemingly curves is made better (regarding the cmd/bat automation scripts) reading on DS than we seen in awhile. Also had me digging up and comparing previous notes that you've been so generous to share in earlier answers lodged about in this topic thread.
     
  11. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,174
    Location:
    NSW, Australia
    The instructions in the DS website are appalling. I had to use trial and error. Mainly error.
     
  12. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    Yes, Brian and myself have been pounding the keyboards. This thread almost overheated.
     
  13. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    Brian, what is the difference from this one to the previous one you posted in #1352?
    You said you were very happy with it. Which one should I use? And will referencing HD1 copy all
     
  14. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    Where is the day, month, year in the code if I need to switch them around.

    The Drive Snapshot website lists these.

     
  15. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,174
    Location:
    NSW, Australia
    Hadron,

    Use #1358. It's more polished and it will lead to differential backups. When you are ready!

    HD1 backs up all the partitions. If you had 20 partitions, they would all be backed up.

    Please let me know what you think of this script.
     
  16. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,174
    Location:
    NSW, Australia
    Let's leave that for later.
     
  17. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    OK, Brian.

    BTW. IFW v3.29 has been released.
     
  18. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,174
    Location:
    NSW, Australia
    Thanks, I didn't know.
     
  19. paulderdash

    paulderdash Registered Member

    Joined:
    Dec 27, 2013
    Posts:
    4,644
    Location:
    Under a bushel ...
    I recall earlier tutorials from Brian in this now rather long thread.

    One needs a Complete Guide compilation as a sticky :D.
     
  20. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    Yes, an edited version with all the different code options depending on what the user requires. And any wrongs removed.
    I really like the way it works. I haven't yet done a restoration since all the posts we did as I've been busy doing other things today. But I will.

    I am quietly confident that with the right scripts, this could be a light, powerful and reliable (hopefully) little backup application.
     
  21. EASTER

    EASTER Registered Member

    Joined:
    Jul 28, 2007
    Posts:
    11,126
    Location:
    U.S.A. (South)
    DS having stood the test of proven results and time on this end without issues (mostly full image backups/restores), I have to admit was plenty enough for me until wanting to get into differentials. @Brian K (before that markymoo) pasted some useful scripts that automated this process with DS and Windows script processor making it simpler.

    By occasion of these type of interests being raised again lays down more traction for making the most of DS IMO. As it stands on this end we use a Macrium Reflect + DS on a thumb drive for those rescue issues. But the routine of cmd/bat process gives a lift to DS that most, frankly, pass up since it's not all-in-one like some imagers.

    It's one of those useful overlooks I think that is always been available but unless someone brings it up for some discussion it gets brushed aside. Thanks @Brian K for your trial n error sessions with it that helps us DS users squeeze out just a little more of the features
     
    Last edited: Apr 26, 2019
  22. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,174
    Location:
    NSW, Australia
    To restore Hadron's Entire Disk backup...

    Boot a WinPE and run snapshot64.exe. Restore complete Disk from Images. Browse, select any one of your 3 images. It doesn't matter which one. Open. You will now see all 3 images are ticked. Select the disk to restore to - HD1 in your case. Confirm it's the correct HD by looking at the rectangles at the bottom. Leave the tick in Restore the partition structure. Next. Yes. OK. It's done!

    If you have experienced a HD failure and you are restoring to an empty new HD, the rectangle at the bottom will say "FREE". All other instructions apply.

    Does that sound easy?
     
  23. oliverjia

    oliverjia Registered Member

    Joined:
    Jul 21, 2005
    Posts:
    1,926
    So is the issue with hiberfil.sys and pagefile.sys not being excluded during full disk image backup resolved? I haven't been using DS for a long while and has no idea how it evolved lately.
     
  24. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,174
    Location:
    NSW, Australia
    Yes, using --UseVSS fixed it.
     
  25. EASTER

    EASTER Registered Member

    Joined:
    Jul 28, 2007
    Posts:
    11,126
    Location:
    U.S.A. (South)
    So #1358 adjustments boil down to just the 3 set lines?
    Plus i never would have thought UseVSS would been a remedy but looks like it does just that. Also great catch on :: to drop the command window.
     
  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.