1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: My Backup PC is out of room.

Discussion in 'DOS/Other' started by stomp, Feb 6, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. stomp

    stomp Thread Starter

    Joined:
    Jul 27, 2006
    Messages:
    108
    I have a PC set aside to just back up a server. Its faster for me to recover from the PC then tapes. Anyway I want just one folder to have the back up in and I want the back up to keep over writing the old data every 4 hours. But my batch is creating a new folder for every back up and I am now out of space. So my question is how should I modify my batch to overwrite?

    Code:
    @echo off
    :: variables
    set drive=c:\Backup
    set folder=%date:~7,2%
    set backupcmd=xcopy /s /c /d /e /h /i /r /k /y
    
    echo ### Backing up directory...
    %backupcmd% "G:\" "%drive%\%folder%"
    
    echo Backup Complete!
    @pause
     
  2. JohnWill

    JohnWill Retired Moderator

    Joined:
    Oct 19, 2002
    Messages:
    106,418
    Personally, I'd use a real backup utility. Cobian Backup can be scheduled to run as often as you like, and it automatically limits the number of copies it keeps, does full, differential, and incremental backups.
     
  3. stomp

    stomp Thread Starter

    Joined:
    Jul 27, 2006
    Messages:
    108
    Got it I just removed "set folder=%date:~7,2%" so now it will not make a folder every time. Oh and this is a real backup utility now and with task scheduler it backs up every 12 hours. And look how small it is.

    @echo off
    :: variables
    set drive=c:\Backup
    set backupcmd=xcopy /s /c /d /e /h /i /r /k /y

    echo ### Backing up directory...
    %backupcmd% "G:\" "%drive%\"

    echo Backup Complete!
    @pause
     
  4. JohnWill

    JohnWill Retired Moderator

    Joined:
    Oct 19, 2002
    Messages:
    106,418
    Whatever floats your boat.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/541685

  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.
    Dismiss Notice