Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Programming Languages A Place for windows applications programs and programmers .

Programming Languages Thread, Bat file to sum sizes of most recently created zip files in Programming , WebDesign & Development; Hi, I'm trying to get a bat file that decides which kind of backup to do by comparing the sizes ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=11503


Reply
LinkBack Thread Tools Display Modes
Bat file to sum sizes of most recently created zip files
 
 
Senior Member

Reply With Quote
 
Join Date: Dec 2008
Posts: 18,122
02-01-2009, 04:11 AM
 
Hi, I'm trying to get a bat file that decides which kind of backup to do by comparing the sizes of the most recent full and differential backups. This is what I am working with: 1) I store copies of my backups online. Due to my online...

Hi,
I'm trying to get a bat file that decides which kind of backup to do by comparing the sizes of the most recent full and differential backups.
This is what I am working with:
1) I store copies of my backups online. Due to my online storage provider's 2GB file size upload limit, I use Cobian Backup's ability to set a max size for each backup zip file so it automatically spans backups across multiple zip files. I end up with 5-10 2GB zip files for a full backup.
2) Cobian Backup names their backups the same way whether it is a full or differential backup. They advise using their log to tell which is which. The only way to tell which is which is to look at their the size, so I put fulls into a folder called Fulls and differentials into a folder called Diffs.
3) Cobian names the files "SourceFolder yyyy-MM-dd hh;mm;ss.zip" then the spanned files' extensions begin .z01, .z02, etc. with the same filename as the original.
I want the bat file to do differential backups until they reach 50% of the size of a full, then do a full instead. This is what I've go so far, but it only gets the size of one file into a variable so there's still a long way to go...

set filepath=c:\
set filename=testfile
set fileextension=.txt
dir /-c "%filepath%%filename%%fileextension%" | find "%filename%%fileextension%" > c:\temp.txt
for /f "tokens=1,2,3,4,5 delims= " %%i in ('type c:\temp.txt') do (set size=%%l)
echo The size of %filepath%%filename%%fileextension% is %size% bytes
pause
I have WIndows XP. Thank you for your help.
 
 
 
Reply

Programming Languages Thread, Bat file to sum sizes of most recently created zip files in Programming , WebDesign & Development; Hi, I'm trying to get a bat file that decides which kind of backup to do by comparing the sizes ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=11503


Bookmarks

Tags
bat, created, file, files, recently, sizes, sum, zip


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump