Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a batchfile that will backup specific mapped drive directory folders & its contents and want to add the creation of a log file, 'bakuplog' to a specific path showing time, date & PC used for backup. Will the log file history remain?
I attempted
ECHO %time% %date% >> C:\<my path>\backuplog.txt
.....but it did not work. I also need scripting that will show &verify that the file was, or not, created. Please help.
Eddieduce

I would put this as the first line in the script so it shows up at the top the log file:
echo Backup started at %time% on %date% on workstation %computername% > backuplog.txt
Then for the additional logging use the >> redirector to append the actual log to the file.
"Computer security." — Oxymoron

This is what I have written:
:Log Backup Start
echo %date% Backup started at %time% on
workstation %computername% > backuplog.txtand
:Log Backup End
ECHO A log file is now being creted. . .
echo %date% Backup ended at %time% on
workstation %computername% >> backuplog.txtIs this what you ment? I tried this, and also using a single simbol but it overwrites everything.
Eddieduce

Try this:
if not exist BackupLog.txt echo BackupLog file>BackupLog.txt
echo Creating Log file...
echo.>>BackupLog.txt
echo Date: %date% >>BackupLog.txt
echo Time: %time% >>BackupLog.txt
echo Computer Name: %computername% >>BackupLog.txt

".....but it did not work"
doesn't say much.
"ECHO %time% %date% >> C:\<my path>\backuplog.txt"
The only way that could fail is if the <my path> did not exist.
=====================================
If at first you don't succeed, you're about average.M2

I got it right now. The issue was that the <My Address> was incorrect.
How can I have the batch file verify and show me the results on weather the log file was correctly updated or not?
Eddieduce

![]() |
Enter data into field wit...
|
flac file
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |