Re: dos batch programmer help!!
- From: assafm@xxxxxxxxx
- Date: 22 Jul 2006 08:11:06 -0700
Thank you very much, for all of you who tried to help me
Thanks again, It works. :-)
there is another section in the "backup.bat" file i need your help with
for /F "tokens=2-4 delims=/- " %%A in ('date/T') do set var=
%%B.%%A.%%C
md %var%
cd C:\%var%\
those lines create a folder with today date, with a specific format
and then i use xcopy to backup the files to this folder on the external
drive
after X days of backuping, i have X folders on the hd, for example:
20.07.2006
21.07.2006
22.07.2006
i need to add a section that check the hd disk space
if it's less then 1 gb
then it should delete the oldest folder
i will appreciate any help,
thanks very very much
Assaf M.
pete@xxxxxxxxxxxxxxxxxx כתב:
In article <5tv2c29gdjoq9v5f1i0f7fbiqlmb393vem@xxxxxxx>
tdavis@xxxxxxxxxxxxxxxxxxxx "Ted Davis" writes:
On Fri, 21 Jul 2006 19:10:25 +0000 (UTC), pete@xxxxxxxxxxxxxxxxxx
wrote:
[ much rubbish :-( ]
vol | find "Serial"
returns the volume serial number as a string. That's what most people
seem to mean by "HD serial number". I'm pretty sure DOS 6.2 had that.
It does indeed -- I'd forgotten about VOL (and missed it in the
original post)
I would simply make the volume label indicate the day, and test for
that with a FIND command.
Alternatively [aimed at the Assaf M] try the batch below:
HBACKUP.BAT:
============
@echo off
REM Set up your two serial numbers here and ensure dir C:\TEMP\ exists
REM [test assumes the two H: drives have s/ns ABCD-1234 and ABCD-5678]
set disk1=ABCD-1234
set disk2=ABCD-5678
REM FIND returns errorlevel 0 if "text" is found, 1/2 if not found/error
:: ------------
vol h: | find "%disk1%" >nul
if errorlevel 1 goto otherdisk
REM == we found this disk s/n
type c:\temp\lastrun.txt | find "%disk1%" >nul
if errorlevel 1 goto backup_OK
echo Wrong disk(1) in H: -- swap it to allow backup to continue!
goto end
:: ------------
:otherdisk
REM == found the other disk s/n
type c:\temp\lastrun.txt | find "%disk2%" >nul
if errorlevel 1 goto backup_OK
echo Wrong disk(2) in H: -- swap it to allow backup to continue!
goto end
:: ------------
:backup_OK
REM == do your backup stuff here
echo Doing backup...
REM
REM == and update the "lastrun" file
vol h: | find "Serial" >c:\temp\lastrun.txt
:end
set disk1=
set disk2=
echo.
=============
Apologies for the bad info.
Pete
--
"We have not inherited the earth from our ancestors,
we have borrowed it from our descendants."
.
- Follow-Ups:
- Re: dos batch programmer help!!
- From: Ted Davis
- Re: dos batch programmer help!!
- References:
- dos batch programmer help!!
- From: assafm
- Re: dos batch programmer help!!
- From: assafm
- Re: dos batch programmer help!!
- From: pete
- Re: dos batch programmer help!!
- From: Ted Davis
- Re: dos batch programmer help!!
- From: pete
- dos batch programmer help!!
- Prev by Date: Re: dos batch programmer help!!
- Next by Date: How to delete old folders??
- Previous by thread: Re: dos batch programmer help!!
- Next by thread: Re: dos batch programmer help!!
- Index(es):
Relevant Pages
|