"Joachim Hofmann" <(E-Mail Removed)> wrote in message
news:O$(E-Mail Removed)...
> Pegasus (MVP) wrote:
>
> > Have you tried copying your files manually? If yes, by what method?
>
> Not so easy to reproduce by day.
> This special case normally only happens on a Saturday, when the Admin was
> not
> present to delete old files manually, so that on this day there is less
> disk
> space.
> On Mo-Fr, when there is more space, it works.
>
> Example:
> disk free: 66381103104
> file size: 30682228224
> -> copy ok
>
> So I thought it could be a difference between actual disk space and
> calculated
> disk space.
>
> > Let's have a look at your batch file.
>
> 1 FOR /F "usebackq" %%F in (`DIR %BasePath% /AD /B`) DO (
> 2 FOR /F "usebackq tokens=2 delims= " %%D IN (`DATE /t`) DO (
> 4 FOR %%B IN (%BasePath%%%F\%Filemask%) DO (
> 5 ECHO Backup: %%~nxB to %%~nB_%%D%%~xB... >> logfile.log
> 6 ECHO Comparing free disc space and file size ...
> 7 FOR /F "usebackq tokens=3 delims=, " %%I IN (`DIR /-c ^| findstr
> "Bytes.frei"`) DO (
> 8 IF %%~zB GTR %%I (
> 9 ECHO No space -%%I- for file -%%~zB- , deleting existing
> file before copying new one
> >> logfile.log
> 10 DEL %ZielMandantPfad%%%F\%%i >> logfile.log 2>&1
> 11 ) ELSE (
> 12 ECHO Space enough -%%I- for file -%%~zB- >> logfile.log
> 13 ))
> 14 COPY %%B %ZielMandantPfad%%%F\%%~nB_%%D%%~xB >>
> BefehlsausgabenVoll.log 2>&1
> 15 ...
>
>
> In 4 I get the file name into %%B
> In 7 I put the "Bytes free" output into %%I
> In 8 I compare these two values to decide what to do: deleting existing
> file or
> not
>
> Hmm.. as I write this, I notice that in 10 I am using %%i, I think it
> should be
> %%B; %%i is a size variable.
>
> I will change that and watch what the job does.
>
> Joachim
>
No, %%i is not a size variable, it is nothing because it is in lower case.
Your code does not appear to set it in any way.
|