home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 41,006 of 42,547   
   justin.lamantia@gmail.com to All   
   Batch File to Create 25 backs up then at   
   18 Sep 14 09:11:42   
   
   [code]   
   :: --- BATCH SCRIPT START ---   
   :: --- Batch File to Copy and create new folder for AMAG Backup's ---   
   :: --- Created By: Me ---   
   @echo off   
   net use Z: \\smcbackup\amag /PERSISTENT:YES   
   setlocal enabledelayedexpansion   
   for /F "tokens=2-4 delims=/- " %%A in ('date/T') do set target=Z:\AMAG   
   Backup\GLOBALSRV\%%C-%%B-%%A-AMAG Back Up   
   xcopy "D:\Program Files\Microsoft Sql Server\MSSQL\Backup\*" "%target%\" /E /-Y   
   setlocal   
   set source=Z:\AMAG Backup\GLOBALSRV   
   pushd "%source%"   
   FOR /F "skip=25 delims=" %%a IN ('DIR /B /AD 25?????? ^| SORT /R') DO RD /S /Q   
   "%%a"   
   popd   
   endlocal   
   :: --- BATCH SCRIPT END ---   
   [/code]   
      
   Somethings not working right...I believe its here...   
   [code]   
   FOR /F "skip=25 delims=" %%a IN ('DIR /B /AD 25?????? ^| SORT /R') DO RD /S /Q   
   "%%a"   
   [/code]   
      
   I need it do do run concurent 25 folders...then at the 26th time it runs it   
   removes the 1st folder to create the 26...the next day to remove the 2nd and   
   create the 27th...Basically a circulatory back up that keeps the newest 25   
   folders always...   
      
   This Batch file runs Daily once a day...   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca