We help IT Professionals succeed at work.

ntbackup batch files

SuprSpy79
SuprSpy79 asked
on
1,552 Views
Last Modified: 2013-11-14
I have an external usb drive to backup a server. I want to make a new file each day for two weeks, and then have it start overwriting the oldest one. I dont think this is possible with the native ntbackup interface but from what I have read it looks like it is possible with a batch file that does the moving and deleting and then letting ntbackup launch from it.

I need to make a single icon on the desktop for the end user (idiot proof) so they can launch the backup and see a message when its done.

Any help would be greatly appreciated
Comment
Watch Question

CERTIFIED EXPERT

Commented:
What is the command you are currently using to create backups?  Also, to be specific, you want a maximum of 14 files (days) stored on the USB drive, correct?

Author

Commented:
well what im doing now is i created a backup using the wizard, and i set it to a date earlier than today so it never runs because the user needs to initiate this backup in the morning.

so I have them open scheduled tasks, right click it and run, but that will only over right, or make one GIANT file.

This is the current string in the scheduled task

C:\WINDOWS\system32\ntbackup.exe backup "@C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data\MorningBackup.bks" /a /d "Set created 6/7/2007 at 9:38 AM" /v:yes /r:no /rs:no /hc:off /m normal /j "MorningBackup" /l:s /f "E:\Backup.bkf"

Yes Id like to keep an archive of 14 days

Regards
Lee W, MVPTechnology and Business Process Advisor
CERTIFIED EXPERT
Most Valuable Expert 2013

Commented:
Give me a day and you might have it - I've had a batch file for running NTBackups posted on my web site for some time.  I'm hoping to modify it today (was working on it last night, but hit a problem I couldn't resolve then) and expect to have an updated version ready that will allow automated deletions based on a set number of weeks to preserve.

You can get the current version - WITHOUT the automated deletions - at http://www.lwcomputing.com/mysoftware.asp

Author

Commented:
great i will keep an eye on it. please post here when its ready.
Lee W, MVPTechnology and Business Process Advisor
CERTIFIED EXPERT
Most Valuable Expert 2013

Commented:
No promises - I'm trying to work out the shifting issue - basically, the script would ask you how many weeks you want to save, then on a given day, it would shift Current Week to Week 1, Week 1 to Week 2, Week 2 to Delete and delete the contents of Delete.  But I'm having issues automating this - when I can get them worked out (I have my own open question on this) it should work nicely.

Author

Commented:
could you just check the date on the folders and IF the date is greater than X days away from current date delete it? x being the number of days you want to keep?
Lee W, MVPTechnology and Business Process Advisor
CERTIFIED EXPERT
Most Valuable Expert 2013

Commented:
Date checking and comparison is not easy in a batch file for these purposes - it can be done, but it's not easy.  However, I do have my solution and I will be working on the batch file later today.

Author

Commented:
ok let me know, otherwise I know a software guy who could whip up a small exe that you could call to do date checing.
Lee W, MVPTechnology and Business Process Advisor
CERTIFIED EXPERT
Most Valuable Expert 2013

Commented:
Ok - I think it's ready.  TEST IT FIRST.  I did some testing myself and I think it's ok, but TEST IT FIRST.
Take a look at BackupAssist (http://www.backupassist.com). It's a very friendly front end to NTBACKUP. It takes care of scheduling and various backup schemes. There is a 30 day free trial. I use it to backup small servers to NAS. It's really very good and not at all expensive.

Author

Commented:
leew, i tried v 1,07 and did not see any options for a backup scheme as far as how many days to keep etc.
Lee W, MVPTechnology and Business Process Advisor
CERTIFIED EXPERT
Most Valuable Expert 2013

Commented:
You need 1.1, not 1.07 - in addition, it does it by weeks, not days.

Author

Commented:
ok  will take a look at it again tonight.
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions