Discussion:
Windows 2003: Dynamic Filename for Backup Name
(too old to reply)
b***@hotmail.com
2010-02-11 18:57:35 UTC
Permalink
Hi,

I am looking to schedule a regular backup in Win 2003 using the
default backup utility.
I would like the name of the backup file to be dynamic, with a date
and time stamp.
Date is more important than time; If I can get a filename with the
date, but without a
timestamp, that is fine.

For example, today's backup should be Feb_11_2010_6PM_File_Backup,
though Feb_11_2010_File_backup will do.

Next week's today be Feb_11_2010_5_59PM_File_Backup, etc..

The specific date and timestamp format is not important to me.

I am hoping that I can specify a filename such as
<datestamp>_<timestamp>_File_Backup,
and that the Windows scheduler will be able to create a filename with
the timestamps.
Is that possible?



Thanks,
QZ

Can this be done?
Pegasus [MVP]
2010-02-11 21:29:42 UTC
Permalink
Post by b***@hotmail.com
Hi,
I am looking to schedule a regular backup in Win 2003 using the
default backup utility.
I would like the name of the backup file to be dynamic, with a date
and time stamp.
Date is more important than time; If I can get a filename with the
date, but without a
timestamp, that is fine.
For example, today's backup should be Feb_11_2010_6PM_File_Backup,
though Feb_11_2010_File_backup will do.
Next week's today be Feb_11_2010_5_59PM_File_Backup, etc..
The specific date and timestamp format is not important to me.
I am hoping that I can specify a filename such as
<datestamp>_<timestamp>_File_Backup,
and that the Windows scheduler will be able to create a filename with
the timestamps.
Is that possible?
Thanks,
QZ
Can this be done?
It can certainly be done but I suppose you really want to know HOW it can be
done. Here is a method:

1. Use the ntbackup GUI interface to create a backup job. Make sure to
specify that it should not run now but later.
2. Open the Task Scheduler, then open the backup job that you just created.
3. Mark & copy the whole command line.
4. Create the new batch file c:\Windows\MyBackup.bat
5. Paste the backup command line into it.
6. Create some blank lines at the top of the file, then paste the following
code into the empty space. Use copy & paste - do not retype it!
@echo off
set MyDate=%date:/=_%_%time::=_%
ntbackup /.. /.. /.. /F d:\Backups\%MyDate%_File_Backup.bkf
7. Adjust the last line of the above code so that it matches your own
switches, then remove the original ntbackup command line.
8. Use the Task Scheduler to create a task that will invoke
c:\Windows\MyBackup.bat instead of your previous ntbackup command
b***@hotmail.com
2010-02-11 22:27:30 UTC
Permalink
Post by Pegasus [MVP]
Post by b***@hotmail.com
Hi,
I am looking to schedule a regular backup in Win 2003 using the
default backup utility.
I would like the name of the backup file to be dynamic, with a date
and time stamp.
Date is more important than time; If I can get a filename with the
date, but without a
timestamp, that is fine.
For example, today's backup should be Feb_11_2010_6PM_File_Backup,
though Feb_11_2010_File_backup will do.
Next week's today be Feb_11_2010_5_59PM_File_Backup, etc..
The specific date and timestamp format is not important to me.
I am hoping that I can specify a filename such as
<datestamp>_<timestamp>_File_Backup,
and that the Windows scheduler will be able to create a filename with
the timestamps.
Is that possible?
Thanks,
QZ
Can this be done?
It can certainly be done but I suppose you really want to know HOW it can be
1. Use the ntbackup GUI interface to create a backup job. Make sure to
specify that it should not run now but later.
2. Open the Task Scheduler, then open the backup job that you just created.
3. Mark & copy the whole command line.
4. Create the new batch file c:\Windows\MyBackup.bat
5. Paste the backup command line into it.
6. Create some blank lines at the top of the file, then paste the following
code into the empty space. Use copy & paste - do not retype it!
  set MyDate=%date:/=_%_%time::=_%
  ntbackup /.. /.. /.. /F d:\Backups\%MyDate%_File_Backup.bkf
7. Adjust the last line of the above code so that it matches your own
switches, then remove the original ntbackup command line.
8. Use the Task Scheduler to create a task that will invoke
c:\Windows\MyBackup.bat instead of your previous ntbackup command- Hide quoted text -
- Show quoted text -
Hi,

Thanks for the information. I will likely try this.
Parthiban Sundaram
2011-05-21 02:03:08 UTC
Permalink
I can understand only the steps, Could you please give me an example.

Where I have to mention the source and destination path.

I dont understand the line " =_%ntbackup /.. /.. /.. /F d:\Backups\%MyDate%_File_Backup " and also could you please tell me what is the original ntbackup command line.

Thank & Regards

Parthi
Post by b***@hotmail.com
Hi,
I am looking to schedule a regular backup in Win 2003 using the
default backup utility.
I would like the name of the backup file to be dynamic, with a date
and time stamp.
Date is more important than time; If I can get a filename with the
date, but without a
timestamp, that is fine.
For example, today's backup should be Feb_11_2010_6PM_File_Backup,
though Feb_11_2010_File_backup will do.
Next week's today be Feb_11_2010_5_59PM_File_Backup, etc..
The specific date and timestamp format is not important to me.
I am hoping that I can specify a filename such as
<datestamp>_<timestamp>_File_Backup,
and that the Windows scheduler will be able to create a filename with
the timestamps.
Is that possible?
Thanks,
QZ
Can this be done?
Post by Pegasus [MVP]
It can certainly be done but I suppose you really want to know HOW it can be
1. Use the ntbackup GUI interface to create a backup job. Make sure to
specify that it should not run now but later.
2. Open the Task Scheduler, then open the backup job that you just created.
3. Mark & copy the whole command line.
4. Create the new batch file c:\Windows\MyBackup.bat
5. Paste the backup command line into it.
6. Create some blank lines at the top of the file, then paste the following
code into the empty space. Use copy & paste - do not retype it!
@echo off
set MyDate=%date:/=_%_%time::=_%
ntbackup /.. /.. /.. /F d:\Backups\%MyDate%_File_Backup.bkf
7. Adjust the last line of the above code so that it matches your own
switches, then remove the original ntbackup command line.
8. Use the Task Scheduler to create a task that will invoke
c:\Windows\MyBackup.bat instead of your previous ntbackup command
Post by Pegasus [MVP]
be
d.
ng
uoted text -
Hi,
Thanks for the information. I will likely try this.
Loading...