Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Server 2008 backup, how to spit output of batch file to .txt for a log?

The only way to backup over a LAN on server 2008 nativley on a schedule is to have it run as a task. So every day at midnight my server runs a batch file that starts the backup.

My questions is can I have the output of this process put in a .txt file automatically?

All of my other servers are server 2003 and they use NT Backup. It spits out a nice log that goes into a folder that I review everyday.

It would be nice to know what's actually going on.
1 Solution
If you open Windows Server Backup you can see on the 1st page if the backup is ok or not
I'm not sure what you are starting exactly in your .cmd file (or .bat file), but you should be able to redirect the output of whatever command you are running inside the batch script to a .txt or .log file by using the ">" sign (or >> to append to an existing file).

For example, to capture the output of a dir command:
dir > mydir.txt

Open in new window

To capture all output from all commands at once, you could instead add the output redirection to where you call the batch script in your scheduled job (instead of adding it on each line in the batch script). For example, use the following to call your script from your scheduled task:

cmd.exe /c myscript.cmd > c:\log\mylog.txt

Open in new window

Or did I misunderstand your question?

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now