variable system

  • Thread starter Thread starter luc bonenfant
  • Start date Start date
L

luc bonenfant

hello,

I 'd like to backup files every nights in a new "bkf" file via ntbackup (svr
2003) for example :

c:\backup\2008_06_04.bkf
c:\backup\2008_06_05.bkf
c:\backup\2008_06_06.bkf
..

I 'd like to use %date% but it looks like 2008/06/04 so "/" don't works fine
in files name.

Any solutions ?

thank's

PS : if you have the complete nt backup command for this, I ll be glade !
 
Hello luc,

I use this one to crate a date in a filename with .vbs script:
strDate = Year(Now) & "_" & Right("0" & Month(Now),2) & "_" & Right("0" &
Day(Now),2)

Best regards

Meinolf Weber
Disclaimer: This posting is provided "AS IS" with no warranties, and confers
no rights.
** Please do NOT email, only reply to Newsgroups
** HELP us help YOU!!! http://www.blakjak.demon.co.uk/mul_crss.htm

> hello,
>
> I 'd like to backup files every nights in a new "bkf" file via
> ntbackup (svr 2003) for example :
>
> c:\backup\2008_06_04.bkf
> c:\backup\2008_06_05.bkf
> c:\backup\2008_06_06.bkf
> .
> I 'd like to use %date% but it looks like 2008/06/04 so "/" don't
> works fine in files name.
>
> Any solutions ?
>
> thank's
>
> PS : if you have the complete nt backup command for this, I ll be
> glade !
>
 
Try this in your batch file:
set MyDate=%Date:/=-%
echo %MyDate%

"luc bonenfant" <luc@beg-ing.com> wrote in message
news:eOqQAWvxIHA.1772@TK2MSFTNGP03.phx.gbl...
> hello,
>
> I 'd like to backup files every nights in a new "bkf" file via ntbackup
> (svr 2003) for example :
>
> c:\backup\2008_06_04.bkf
> c:\backup\2008_06_05.bkf
> c:\backup\2008_06_06.bkf
> .
>
> I 'd like to use %date% but it looks like 2008/06/04 so "/" don't works
> fine in files name.
>
> Any solutions ?
>
> thank's
>
> PS : if you have the complete nt backup command for this, I ll be glade !
>
 
yes

%Date:/=-%

exactly what I need !!!

do you know where can I find any explaination on how format system variable
and list of variable and so on ....

Thank's a lot !!!

"Pegasus (MVP)" <I.can@fly.com.oz> a écrit dans le message de news:
eVKzy$vxIHA.6096@TK2MSFTNGP06.phx.gbl...
> Try this in your batch file:
> set MyDate=%Date:/=-%
> echo %MyDate%
>
> "luc bonenfant" <luc@beg-ing.com> wrote in message
> news:eOqQAWvxIHA.1772@TK2MSFTNGP03.phx.gbl...
>> hello,
>>
>> I 'd like to backup files every nights in a new "bkf" file via ntbackup
>> (svr 2003) for example :
>>
>> c:\backup\2008_06_04.bkf
>> c:\backup\2008_06_05.bkf
>> c:\backup\2008_06_06.bkf
>> .
>>
>> I 'd like to use %date% but it looks like 2008/06/04 so "/" don't works
>> fine in files name.
>>
>> Any solutions ?
>>
>> thank's
>>
>> PS : if you have the complete nt backup command for this, I ll be glade !
>>

>
>
 
arf bad news !

it works well in cmd when I launch the ntbackup command but in the task
scheduler,
ntbackup start and stop directly.

:-(

"luc bonenfant" <luc@beg-ing.com> a écrit dans le message de news:
%23h4KqIwxIHA.1504@TK2MSFTNGP05.phx.gbl...
> yes
>
> %Date:/=-%
>
> exactly what I need !!!
>
> do you know where can I find any explaination on how format system
> variable and list of variable and so on ....
>
> Thank's a lot !!!
>
> "Pegasus (MVP)" <I.can@fly.com.oz> a écrit dans le message de news:
> eVKzy$vxIHA.6096@TK2MSFTNGP06.phx.gbl...
>> Try this in your batch file:
>> set MyDate=%Date:/=-%
>> echo %MyDate%
>>
>> "luc bonenfant" <luc@beg-ing.com> wrote in message
>> news:eOqQAWvxIHA.1772@TK2MSFTNGP03.phx.gbl...
>>> hello,
>>>
>>> I 'd like to backup files every nights in a new "bkf" file via ntbackup
>>> (svr 2003) for example :
>>>
>>> c:\backup\2008_06_04.bkf
>>> c:\backup\2008_06_05.bkf
>>> c:\backup\2008_06_06.bkf
>>> .
>>>
>>> I 'd like to use %date% but it looks like 2008/06/04 so "/" don't works
>>> fine in files name.
>>>
>>> Any solutions ?
>>>
>>> thank's
>>>
>>> PS : if you have the complete nt backup command for this, I ll be glade
>>> !
>>>

>>
>>

>
>
 
Type
set /?
and look for "Character substitution" to see how I replaced
slashes with dashes.

The failure you report is unlikely to be caused by the %MyDate%
substitution. Post your backup command so that we can see
what you're doing.


"luc bonenfant" <luc@beg-ing.com> wrote in message
news:udeb1OwxIHA.2292@TK2MSFTNGP03.phx.gbl...
> arf bad news !
>
> it works well in cmd when I launch the ntbackup command but in the task
> scheduler,
> ntbackup start and stop directly.
>
> :-(
>
> "luc bonenfant" <luc@beg-ing.com> a écrit dans le message de news:
> %23h4KqIwxIHA.1504@TK2MSFTNGP05.phx.gbl...
>> yes
>>
>> %Date:/=-%
>>
>> exactly what I need !!!
>>
>> do you know where can I find any explaination on how format system
>> variable and list of variable and so on ....
>>
>> Thank's a lot !!!
>>
>> "Pegasus (MVP)" <I.can@fly.com.oz> a écrit dans le message de news:
>> eVKzy$vxIHA.6096@TK2MSFTNGP06.phx.gbl...
>>> Try this in your batch file:
>>> set MyDate=%Date:/=-%
>>> echo %MyDate%
>>>
>>> "luc bonenfant" <luc@beg-ing.com> wrote in message
>>> news:eOqQAWvxIHA.1772@TK2MSFTNGP03.phx.gbl...
>>>> hello,
>>>>
>>>> I 'd like to backup files every nights in a new "bkf" file via ntbackup
>>>> (svr 2003) for example :
>>>>
>>>> c:\backup\2008_06_04.bkf
>>>> c:\backup\2008_06_05.bkf
>>>> c:\backup\2008_06_06.bkf
>>>> .
>>>>
>>>> I 'd like to use %date% but it looks like 2008/06/04 so "/" don't works
>>>> fine in files name.
>>>>
>>>> Any solutions ?
>>>>
>>>> thank's
>>>>
>>>> PS : if you have the complete nt backup command for this, I ll be glade
>>>> !
>>>>
>>>
>>>

>>
>>

>
>
 
I prefere this unique command :

C:\WINDOWS\system32\ntbackup.exe backup "@C:\Documents and
Settings\luc\Local Settings\Application Data\Microsoft\Windows
NT\NTBackup\data\system_state_ad3.bks" /n "SYSTEMESTATE_AD_3.bkf created
17/04/2008 at 15:04" /d "Set created 17/04/2008 at 15:04" /v:yes /r:no
/rs:no /hc:off /m copy /j "system_state_ad3" /l:s /f
"\\Frpoi-bex\E$\ADdeAD3\%date:/=-%_SYSTEMESTATE_AD_3.bkf"

but It can be this one :

set mydate=%date:/=-%

and

C:\WINDOWS\system32\ntbackup.exe backup "@C:\Documents and
Settings\luc\Local Settings\Application Data\Microsoft\Windows
NT\NTBackup\data\system_state_ad3.bks" /n "SYSTEMESTATE_AD_3.bkf created
17/04/2008 at 15:04" /d "Set created 17/04/2008 at 15:04" /v:yes /r:no
/rs:no /hc:off /m copy /j "system_state_ad3" /l:s /f
"\\Frpoi-bex\E$\ADdeAD3\%mydate%_SYSTEMESTATE_AD_3.bkf"

But it don't want in the scheduler. It works fine in the cmd console.


"Pegasus (MVP)" <I.can@fly.com.oz> a écrit dans le message de news:
O9jcxzxxIHA.4492@TK2MSFTNGP02.phx.gbl...
> Type
> set /?
> and look for "Character substitution" to see how I replaced
> slashes with dashes.
>
> The failure you report is unlikely to be caused by the %MyDate%
> substitution. Post your backup command so that we can see
> what you're doing.
>
>
> "luc bonenfant" <luc@beg-ing.com> wrote in message
> news:udeb1OwxIHA.2292@TK2MSFTNGP03.phx.gbl...
>> arf bad news !
>>
>> it works well in cmd when I launch the ntbackup command but in the task
>> scheduler,
>> ntbackup start and stop directly.
>>
>> :-(
>>
>> "luc bonenfant" <luc@beg-ing.com> a écrit dans le message de news:
>> %23h4KqIwxIHA.1504@TK2MSFTNGP05.phx.gbl...
>>> yes
>>>
>>> %Date:/=-%
>>>
>>> exactly what I need !!!
>>>
>>> do you know where can I find any explaination on how format system
>>> variable and list of variable and so on ....
>>>
>>> Thank's a lot !!!
>>>
>>> "Pegasus (MVP)" <I.can@fly.com.oz> a écrit dans le message de news:
>>> eVKzy$vxIHA.6096@TK2MSFTNGP06.phx.gbl...
>>>> Try this in your batch file:
>>>> set MyDate=%Date:/=-%
>>>> echo %MyDate%
>>>>
>>>> "luc bonenfant" <luc@beg-ing.com> wrote in message
>>>> news:eOqQAWvxIHA.1772@TK2MSFTNGP03.phx.gbl...
>>>>> hello,
>>>>>
>>>>> I 'd like to backup files every nights in a new "bkf" file via
>>>>> ntbackup (svr 2003) for example :
>>>>>
>>>>> c:\backup\2008_06_04.bkf
>>>>> c:\backup\2008_06_05.bkf
>>>>> c:\backup\2008_06_06.bkf
>>>>> .
>>>>>
>>>>> I 'd like to use %date% but it looks like 2008/06/04 so "/" don't
>>>>> works fine in files name.
>>>>>
>>>>> Any solutions ?
>>>>>
>>>>> thank's
>>>>>
>>>>> PS : if you have the complete nt backup command for this, I ll be
>>>>> glade !
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>
 
Re: system variable

Your problem lies probably here:
\\Frpoi-bex\E$
What account do you use for the scheduled job? Does
it have write-access to \\Frpoi-bex\E$? You can easily
find out by using the Task Scheduler to run this batch
file:
@echo off
echo %date% %time% %UserName% >> c:\test.txt
copy /y %SystemRoot%\System32\more.com \\Frpoi-bex\E$ 1>>c:\test.txt 2>>&1
C:\WINDOWS\system32\ntbackup.exe backup "@C:\Documents and
Settings\luc\Local Settings\Application Data\Microsoft\Windows
NT\NTBackup\data\system_state_ad3.bks" /n "SYSTEMESTATE_AD_3.bkf created
17/04/2008 at 15:04" /d "Set created 17/04/2008 at 15:04" /v:yes /r:no
/rs:no /hc:off /m copy /j "system_state_ad3" /l:s /f
"\\Frpoi-bex\E$\ADdeAD3\%date:/=-%_SYSTEMESTATE_AD_3.bkf" 1>>c:\test.txt
2>>&1

Now have a look at c:\test.txt - it will tell you a lot! You must also
examine the backup log that is generated by ntbackup.exe.


"luc bonenfant" <luc@beg-ing.com> wrote in message
news:OFUETbyxIHA.4492@TK2MSFTNGP02.phx.gbl...
>I prefere this unique command :
>
> C:\WINDOWS\system32\ntbackup.exe backup "@C:\Documents and
> Settings\luc\Local Settings\Application Data\Microsoft\Windows
> NT\NTBackup\data\system_state_ad3.bks" /n "SYSTEMESTATE_AD_3.bkf created
> 17/04/2008 at 15:04" /d "Set created 17/04/2008 at 15:04" /v:yes /r:no
> /rs:no /hc:off /m copy /j "system_state_ad3" /l:s /f
> "\\Frpoi-bex\E$\ADdeAD3\%date:/=-%_SYSTEMESTATE_AD_3.bkf"
>
> but It can be this one :
>
> set mydate=%date:/=-%
>
> and
>
> C:\WINDOWS\system32\ntbackup.exe backup "@C:\Documents and
> Settings\luc\Local Settings\Application Data\Microsoft\Windows
> NT\NTBackup\data\system_state_ad3.bks" /n "SYSTEMESTATE_AD_3.bkf created
> 17/04/2008 at 15:04" /d "Set created 17/04/2008 at 15:04" /v:yes /r:no
> /rs:no /hc:off /m copy /j "system_state_ad3" /l:s /f
> "\\Frpoi-bex\E$\ADdeAD3\%mydate%_SYSTEMESTATE_AD_3.bkf"
>
> But it don't want in the scheduler. It works fine in the cmd console.
>
>
> "Pegasus (MVP)" <I.can@fly.com.oz> a écrit dans le message de news:
> O9jcxzxxIHA.4492@TK2MSFTNGP02.phx.gbl...
>> Type
>> set /?
>> and look for "Character substitution" to see how I replaced
>> slashes with dashes.
>>
>> The failure you report is unlikely to be caused by the %MyDate%
>> substitution. Post your backup command so that we can see
>> what you're doing.
>>
>>
>> "luc bonenfant" <luc@beg-ing.com> wrote in message
>> news:udeb1OwxIHA.2292@TK2MSFTNGP03.phx.gbl...
>>> arf bad news !
>>>
>>> it works well in cmd when I launch the ntbackup command but in the task
>>> scheduler,
>>> ntbackup start and stop directly.
>>>
>>> :-(
>>>
>>> "luc bonenfant" <luc@beg-ing.com> a écrit dans le message de news:
>>> %23h4KqIwxIHA.1504@TK2MSFTNGP05.phx.gbl...
>>>> yes
>>>>
>>>> %Date:/=-%
>>>>
>>>> exactly what I need !!!
>>>>
>>>> do you know where can I find any explaination on how format system
>>>> variable and list of variable and so on ....
>>>>
>>>> Thank's a lot !!!
>>>>
>>>> "Pegasus (MVP)" <I.can@fly.com.oz> a écrit dans le message de news:
>>>> eVKzy$vxIHA.6096@TK2MSFTNGP06.phx.gbl...
>>>>> Try this in your batch file:
>>>>> set MyDate=%Date:/=-%
>>>>> echo %MyDate%
>>>>>
>>>>> "luc bonenfant" <luc@beg-ing.com> wrote in message
>>>>> news:eOqQAWvxIHA.1772@TK2MSFTNGP03.phx.gbl...
>>>>>> hello,
>>>>>>
>>>>>> I 'd like to backup files every nights in a new "bkf" file via
>>>>>> ntbackup (svr 2003) for example :
>>>>>>
>>>>>> c:\backup\2008_06_04.bkf
>>>>>> c:\backup\2008_06_05.bkf
>>>>>> c:\backup\2008_06_06.bkf
>>>>>> .
>>>>>>
>>>>>> I 'd like to use %date% but it looks like 2008/06/04 so "/" don't
>>>>>> works fine in files name.
>>>>>>
>>>>>> Any solutions ?
>>>>>>
>>>>>> thank's
>>>>>>
>>>>>> PS : if you have the complete nt backup command for this, I ll be
>>>>>> glade !
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>
 
Back
Top