troubleshooting Question

Help with batch file that compares file size to available space

Avatar of einsteinq
einsteinq asked on
Windows Batch
12 Comments3 Solutions93 ViewsLast Modified:
I need a batch file created that can replace a broken backup feature of an old program. I need the batch file to look at the size of the file that will be backed up, compare it to the available space on the F: drive. If there is space, then it copies the file, if there isn't space, then it deletes the oldest file in the destination to make room for a new file.

Basically, I'm backing up one file, once per day, and just need to make sure that that the drive has space before copying. My current batch file is:
@echo off
set mydate=%date:~4,2%_%date:~7,2%_%date:~10,4%
copy /z "C:\Program Files (x86)\Camelot3\Database\CAMDB.FDB" "F:\Camelot\Camdb_%mydate%.fdb

This is just so that I can keep multiple copies of this file
Join our community to see this answer!
Unlock 3 Answers and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros