Schedule Server 2003 Backup Batch File

Posted on  by  admin

Here’s a simple batch file script to backup the Windows Server 2003 System State to a removable drive:

Minecraft Server Start Batch File

Save the script as ssbackup.bat (or whatever name you choose). If you are running the script on a Windows 2000 server, change the path to ntbackup.exe to c:winntsystem32ntbackup.exe

You should modify the following items in the script:

Magix music maker free instruments. Jan 15, 2018 - Magix Music Maker 17 Instrument Package Download. MAGIX Music Maker MX Premium with an incredible add-on package, specially. 2016 Premium Before you start MAGIX Music Maker 2016 Premium free download,.

How to use Schtasks.exe to Schedule Tasks in Windows Server 2003. Or batch file. The run operation ignores the schedule, but uses the program file location.

server04 system state backup to I – This is the backup description.

I:server04server04-system-state-%dtt%.bkf– this is the path to save the backup file to and file name. My file is saved to the I:server04 directory.

I used ssgsergio’s script as my basis for the first part of the script – I never can remember the syntax for using the day-date-time variables (%dtt% in this case).

Fatal error meaning. The inspiration for the second part of the script came from KB 239892, ntbackup help, and looking at the properties of backup I already had setup – you can see these details in Control Panel – Scheduled Tasks, assuming you have a backup already scheduled.

If you’d like explanations of what all the command line options for ntbackup.exe are, from a command prompt run:

The ntbackup syntax is:

Syntax

ntbackup backup [systemstate]@FileName.bks” /J {JobName} [/P {PoolName}] [/G {GUIDName}] [/T {TapeName}] [/N {MediaName}] [/F {FileName}] [/D {SetDescription}] [/DS {ServerName}] [/IS {ServerName}] [/A] [/V:{yesno}] [/R:{yesno}] [/L:{fsn}] [/M {BackupType}] [/RS:{yesno}] [/HC:{onoff}] [/SNAP:{onoff}]

Parameters

systemstate
Specifies that you want to back up the System State data. When you select this option, the backup type will be forced to normal or copy.
@FileName.bks
Specifies the name of the backup selection file (.bks file) to be used for this backup operation. The at (@) character must precede the name of the backup selection file. A backup selection file contains information on the files and folders you have selected for backup. You have to create the file using the graphical user interface (GUI) version of Backup.
/J {JobName}
Specifies the job name to be used in the backup report. The job name usually describes the files and folders you are backing up in the current backup job.
/P {PoolName}
Specifies the media pool from which you want to use media. This is usually a subpool of the Backup media pool, such as 4mm DDS. If you select this you cannot use the /A, /G, /F, or /T command-line options.
/G {GUIDName}
Overwrites or appends to this tape. Do not use this switch in conjunction with /P.
/T {TapeName}
Overwrites or appends to this tape. Do not use this switch in conjunction with /P.
/N {MediaName}
Specifies the new tape name. You must not use /A with this switch.
/F {FileName}
Logical disk path and file name. You must not use the following switches with this switch: /P /G /T.
/D {SetDescription}
Specifies a label for each backup set.
/DS {ServerName}
Backs up the directory service file for the specified Microsoft Exchange Server.
/IS {ServerName}
Backs up the Information Store file for the specified Microsoft Exchange Server.
/A
Performs an append operation. Either /G or /T must be used in conjunction with this switch. Do not use this switch in conjunction with /P.
/V:{yesno}
Verifies the data after the backup is complete.
/R:{yesno}
Restricts access to this tape to the owner or members of the Administrators group.
/L:{fsn}
Specifies the type of log file: f=full, s=summary, n=none (no log file is created).
/M {BackupType}
Specifies the backup type. It must be one of the following: normal, copy, differential, incremental, or daily.
/RS:{yesno}
Backs up the migrated data files located in Remote Storage. The /RS command-line option is not required to back up the local Removable Storage database (that contains the Remote Storage placeholder files). When you backup the %systemroot% folder, Backup automatically backs up the Removable Storage database as well.
/HC:{onoff}
Uses hardware compression, if available, on the tape drive.
/SNAP:{onoff}
Specifies whether or not the backup should use a volume shadow copy.
/M {BackupType}
Specifies the backup type. It must be one of the following: normal, copy, differential, incremental, or daily.
I am running 2 scheduled tasks on a Windows 2003 server. Each of these calls a separate batch file to run various backup and database maintenance processes on a Mimer SQL database. These have both been working correctly for months. In the last 3 days they have stopped working.
When I run the batch files manually (in explorer) they complete everything correctly. When they are set to run as scheduled they do not complete the tasks and return last result 0x2.
I have looked up this code and believe it to mean: ERROR_FILE_NOT_FOUND 2 The system cannot find the file specified. From http://msdn2.microsoft.com/en-us/library/ms681382.aspx
Backup Ive checked the paths and all looks OK. What can this mean?
Coments are closed
Scroll to top