Hi,
I've been trying to setup a script to make a back up on my personal server on a daily basis. I've got the main features working but I'd like to be able to create a log of the entire output of the script. This is the script that I have:
echo off
cls
:: variables
set drive=C:\Backup
set backupcmd=xcopy /e /y /i
set folder=%date:~7,2%
echo Backup Folder Maintenance
RMDIR /S /Q "C:\backup\%folder%"
echo Backup Folder Maintenance Complete
echo Webserver Allain Backup
%backupcmd% "C:\xampp\htdocs\allain" "%drive%\%folder%\Allain Website"
echo Webserver Allain Backup Complete
echo Minecraft Server Backup
%backupcmd% "C:\Minecraft" "%drive%\%folder%\Minecraft"
echo Minecraft Server Backup Complete
echo Backup Complete!
backup.bat >> c:\backup\%folder%\log.txt
@pause
The log gets written (somewhat) but the batch file doesn't copy the minecraft folder and gets stuck in a loop were it writes the log file over and over (I think it's looping but I don't know at what point). This is a partial copy of the batch file when running:
Minecraft Server Backup Complete
Backup Complete!
C:\backup\25\log.txt - The volume for a file has been externally altered so that
the opened file is no longer valid.
C:\backup\25\log.txt - The process cannot access the file because it is being us
ed by another process.
The process cannot access the file because it is being used by another process.
C:\backup\25\log.txt - The process cannot access the file because it is being us
ed by another process.
The process cannot access the file because it is being used by another process.
C:\backup\25\log.txt - The process cannot access the file because it is being us
ed by another process.
At this point it never get to the pause and I need to manually close the console window.
Thank you in advance for your help!
Phil