NT backup command line

Posted on 2003-10-31
Last Modified: 2007-12-19
hi, i just find out that my backup was not working since a while, i have my tape fix and now i try to understand the bat file i have found.
here a look backup.bat
AT 21:30 /interactive /every:L cmd /c del c:\clients\backup\Lundi.log
AT 21:35 /interactive /every:L NTBACKUP BACKUP D:\ C:\ /v/d "Copie securité du Lundi" /l "C:\Clients\Backup\Lundi.log" /b /hc:on

AT 21:30 /interactive /every:M cmd /c del c:\clients\backup\Mardi.log
AT 21:35 /interactive /every:M NTBACKUP BACKUP D:\ C:\ /v/d "Copie securité du Mardi" /l "C:\Clients\Backup\Mardi.log" /b /hc:on

AT 21:30 /interactive /every:Me cmd /c del c:\clients\backup\Mercredi.log
AT 21:35 /interactive /every:Me NTBACKUP BACKUP D:\ C:\ /v/d "Copie securité du Mercredi" /l "C:\Clients\Backup\Mercredi.log" /b /hc:on

AT 21:30 /interactive /every:J cmd /c del c:\clients\backup\Jeudi.log
AT 21:35 /interactive /every:J NTBACKUP BACKUP D:\ C:\ /v/d "Copie securité du Jeudi" /l "C:\Clients\Backup\Jeudi.log" /b /hc:on

AT 21:30 /interactive /every:V cmd /c del c:\clients\backup\Vendredi.log
AT 21:35 /interactive /every:V NTBACKUP BACKUP D:\ C:\ /v/d "Copie securité du Vendredi" /l "C:\Clients\Backup\Vendredi.log" /b /hc:on

also in daily taskt i have 10 job from At1 to At10, what is 2 job per day the fisrt job that erase the log and the second job that do the backup. in task property, these job were create by
how this is done ?
(i erase one job and when i re-create it, it does not have the name AT1)

i look at the command line and still wonder if i can have the tape to eject after backup complete ?

what /interactive  mean ?


Question by:adminsly
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4

Expert Comment

ID: 9661109
The 10 jobs you have (At1 to 10) are the 10 jobs that are created by your batch file. When you erase a job and add a new job, the name of the new job is carried on from the last job that was created. Probably At11 in your case. You can specify the ID of your job by specifying it in your command. Do a "at /?" for more info.

For file backups, you'll need to at least have Backup Operator status to perform the task. You can run it as a member of administrators group as well. The task scheduler has an option to run tasks under another account.

/interactive - Allows the job to interact with the desktop of the user who is logged on at the time the job runs. (From at /?)

I don't see an option to eject the tape after backup though. Do a ntbackup /? to see the options available.

Author Comment

ID: 9662269
thanks to answer,  my batch file do i still need it ? do i need to run it ? do i need to run it from task manager ?
or you just create a batch file to create the schedule job in task manager and after oyu dont really need the batch ?

sorry i dont have my server at home so can not check AT /?


Expert Comment

ID: 9662320
you should keep your batch file for reference in case anything goes wrong, so it's not advisable to delete it anyway as it pertains to data backup.

i believe you mean task scheduler, specifically "scheduled tasks" under control panel, not task manager. task manager is more for viewing running processes on your system.

you'll probably need to run the batch job once to schedule the backups, once created (you can check this by running "at" at the command prompt) you won't need to run them again. however, if the scheduled jobs do not stick after a reboot, you probably would want to point a reference to the batch file in autoexec.bat, ie. in autoexec.bat, type in the following:

call <path>\backup.bat

This is the reference for at /? on an XP Pro machine (my laptop :)). The parameters for that on NT server might be a little bit different.

The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
    [ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername     Specifies a remote computer. Commands are scheduled on the
                   local computer if this parameter is omitted.
id                 Is an identification number assigned to a scheduled
/delete            Cancels a scheduled command. If id is omitted, all the
                   scheduled commands on the computer are canceled.
/yes               Used with cancel all jobs command when no further
                   confirmation is desired.
time               Specifies the time when command is to run.
/interactive       Allows the job to interact with the desktop of the user
                   who is logged on at the time the job runs.
/every:date[,...]  Runs the command on each specified day(s) of the week or
                   month. If date is omitted, the current day of the month
                   is assumed.
/next:date[,...]   Runs the specified command on the next occurrence of the
                   day (for example, next Thursday).  If date is omitted, the
                   current day of the month is assumed.
"command"          Is the Windows NT command, or batch program to be run.

Another alternative would be to port your batch files command to the task scheduler and dump the batch file, so that you can do away with your batch file completely. The task scheduler is a GUI version of the at command, with more options. This will also allow you easier maintenance of your backup process.

Let me know if you have any queries on how to port your commands over to the task scheduler. It's quite straightforward actually.
Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.


Author Comment

ID: 9662794
you right i mean scheduled task, yes tell me how to port the command over the task scheduler.



Accepted Solution

mapledrums earned 20 total points
ID: 9663040
Do a "at /delete" at the command prompt to delete off the previous tasks setup.

Configure the Monday backup logs cleanup.

1) Goto Scheduled Tasks, File, New, Scheduled Task.
2) Give the job a relavant name (eg. Clear Monday Backup Logs).
3) Right cick on the new task, select Properties. Under Run, paste "cmd /c del c:\clients\backup\Lundi.log".
4) Under "Run As", put in an administrative account or backup operator account. Click "Set Password" & enter the respective password.
5) Select the Schedule tab, select Weekly under "Schedule Task:". Set the time and select Monday.

Do the same for the backup task.

Follow step 1 above
In step 2, give a name such as Monday Backups.
In step 3, put in "NTBACKUP BACKUP D:\ C:\ /v/d "Copie securité du Lundi" /l "C:\Clients\Backup\Lundi.log" /b /hc:on" under Run.
In step 4, Under "Run As", put in the same account as the previous task.
Configure the relavant time for step 5.

Do the same for the other 4 days. So you'll have 10 scheduled tasks when you're done. You can do a right click on a task & select Run to test that your task works.

Author Comment

ID: 9663249
mapledrum  thanks but this is easy to do , you know i taught you gonna teach me how to, from my batch file et extract it to task scheduler just with one click or command ;-(

when you do the
AT /delete     that remove all schedule task ?

any suggestion for backup program ?


Expert Comment

ID: 9663346
I'm afraid the job file created is in binary & I'm not sure how to convert or if it can be done.

Yes. The at /delete removes all scheduled tasks.

Some of the more popular/corporate backup programs would be Veritas Backup Exec (;vrtsid=JT4TOBYPQPP3HQFIYCLCFFA?baseId=2021) and BrightStor Arcserve Backup (

Author Comment

ID: 9664275
thanks  mapledrum

Expert Comment

ID: 9665240
No problem. Thanks for the points.

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Storage DRS Recommendation Alert 3 86
esx iscsi connectin creation against multiple hosts 6 58
Scanning using HP Officejet 4650 6 67
Disk clean up on Server 2012 R2 6 43
I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
Many businesses neglect disaster recovery and treat it as an after-thought. I can tell you first hand that data will be lost, hard drives die, servers will be hacked, and careless (or malicious) employees can ruin your data.
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question