Live Chat Software by Kayako |
RES 3700 | Rotate log Backup
Posted by Rafeeq Mylappuram on 17 October 2018 09:39 AM
|
||||
The site wants to move the 3700d.log from the \etc directory to the \archives\hold directory so that they can zip it and store it for future reference if the need arises FOR /L %%1 in (0,1,6) DO IF EXIST c:\micros\res\pos\etc\3700d.log.%%1 copy c:\micros\res\pos\etc\3700d.log.%%1 c:\micros\res\pos\ARCHIVES\HOLD %%1 is a variable that will cause the do if exist command step to repeat 7 times, starting with 0, incrementing by 1, stopping with 6. So, each of the two lines above will run 7 times, the first line will run 7 times, then the second line will run 7 times, copying the 3700d.log.x files from the \etc directory to the \archives\hold then deleting the 3700d.log.x file from the \etc directory. The path can be changed if necessary, and any other command that will execute in a batch file can be substituted for the copy and delete commands above. | ||||
|