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
  • 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.
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.


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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
Lets start to have a small explanation what is VAAI(vStorage API for Array Integration ) and what are the benefits using it. VAAI is an API framework in VMware that enable some Storage tasks. It first presented in ESXi 4.1, but only after 5.x sup…
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
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…

839 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