PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.win.server.scripting > Script to create folder with time stamp and then move into folder
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Script to create folder with time stamp and then move into folder

Réponse
 
LinkBack Outils de la discussion
Vieux 03/12/2007, 21h42   #1
Jim Kiddoo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Script to create folder with time stamp and then move into folder

Hello,
I am trying to script something to creat a folder with the time and date
inthe name and then copy files into it. I have a set of files i want copies
of every hour. Due to the way the app was created the files do not appear to
change since they take a certain size to satrt and then data is appended to
them so the size does nto change. Backup sees that they didnt change so
doesnt back them up again.

Any would be apreciated. I have found an applicaiton to create the
folder with the time and date, but i cant figure out how to copy into that
folder dynamically. I need to bring the name of the folder created by the
app into a copy command. I can redirect the output of the create into a txt
file but how do I read from that to copy into the folder.
Thanks
Jim

  Réponse avec citation
Vieux 03/12/2007, 21h48   #2
Pegasus \(MVP\)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Script to create folder with time stamp and then move into folder


"Jim Kiddoo" <jim.kiddoo@headcount.com> wrote in message
news:64B9FAD6-6509-4D7E-9F4A-97BDFEEA9EAA@microsoft.com...
> Hello,
> I am trying to script something to creat a folder with the time and date
> inthe name and then copy files into it. I have a set of files i want
> copies of every hour. Due to the way the app was created the files do not
> appear to change since they take a certain size to satrt and then data is
> appended to them so the size does nto change. Backup sees that they didnt
> change so doesnt back them up again.
>
> Any would be apreciated. I have found an applicaiton to create the
> folder with the time and date, but i cant figure out how to copy into that
> folder dynamically. I need to bring the name of the folder created by the
> app into a copy command. I can redirect the output of the create into a
> txt file but how do I read from that to copy into the folder.
> Thanks
> Jim


What you require is not hard to achieve but you need to give
a detailed example to illustrate your needs.


  Réponse avec citation
Vieux 03/12/2007, 23h21   #3
Jim Kiddoo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Script to create folder with time stamp and then move into folder

I need to copy around 50 files into a new directory that is stamped with the
current time and date. This needs to be scheduled through the scheduler, so
it has to be scripted to run hourly.

so every hour a new folder is created with a new name and all the files from
the main directory are copied into it. This needs to happen every hour with
a unique folder name every time.

Thanks for any .
Jim


"Pegasus (MVP)" <I.can@fly.com> wrote in message
news:OsW8IZfNIHA.5988@TK2MSFTNGP02.phx.gbl...
>
> "Jim Kiddoo" <jim.kiddoo@headcount.com> wrote in message
> news:64B9FAD6-6509-4D7E-9F4A-97BDFEEA9EAA@microsoft.com...
>> Hello,
>> I am trying to script something to creat a folder with the time and date
>> inthe name and then copy files into it. I have a set of files i want
>> copies of every hour. Due to the way the app was created the files do not
>> appear to change since they take a certain size to satrt and then data is
>> appended to them so the size does nto change. Backup sees that they didnt
>> change so doesnt back them up again.
>>
>> Any would be apreciated. I have found an applicaiton to create the
>> folder with the time and date, but i cant figure out how to copy into
>> that folder dynamically. I need to bring the name of the folder created
>> by the app into a copy command. I can redirect the output of the create
>> into a txt file but how do I read from that to copy into the folder.
>> Thanks
>> Jim

>
> What you require is not hard to achieve but you need to give
> a detailed example to illustrate your needs.
>


  Réponse avec citation
Vieux 04/12/2007, 07h58   #4
Pegasus \(MVP\)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Script to create folder with time stamp and then move into folder

Try this:

@echo off
set T=%time:~0,5%
set dir=%date:/=-% %T::=-%
echo The target folder is "%dir%".
xcopy /s /c /y "E:\Main Directory\*.*" "D:\Backup\%dir%\"


"Jim Kiddoo" <jim.kiddoo@headcount.com> wrote in message
news:88BCFCB0-FC70-4278-A18D-931497B126DA@microsoft.com...
>I need to copy around 50 files into a new directory that is stamped with
>the current time and date. This needs to be scheduled through the
>scheduler, so it has to be scripted to run hourly.
>
> so every hour a new folder is created with a new name and all the files
> from the main directory are copied into it. This needs to happen every
> hour with a unique folder name every time.
>
> Thanks for any .
> Jim
>
>
> "Pegasus (MVP)" <I.can@fly.com> wrote in message
> news:OsW8IZfNIHA.5988@TK2MSFTNGP02.phx.gbl...
>>
>> "Jim Kiddoo" <jim.kiddoo@headcount.com> wrote in message
>> news:64B9FAD6-6509-4D7E-9F4A-97BDFEEA9EAA@microsoft.com...
>>> Hello,
>>> I am trying to script something to creat a folder with the time and date
>>> inthe name and then copy files into it. I have a set of files i want
>>> copies of every hour. Due to the way the app was created the files do
>>> not appear to change since they take a certain size to satrt and then
>>> data is appended to them so the size does nto change. Backup sees that
>>> they didnt change so doesnt back them up again.
>>>
>>> Any would be apreciated. I have found an applicaiton to create the
>>> folder with the time and date, but i cant figure out how to copy into
>>> that folder dynamically. I need to bring the name of the folder created
>>> by the app into a copy command. I can redirect the output of the create
>>> into a txt file but how do I read from that to copy into the folder.
>>> Thanks
>>> Jim

>>
>> What you require is not hard to achieve but you need to give
>> a detailed example to illustrate your needs.
>>

>



  Réponse avec citation
Vieux 04/12/2007, 23h52   #5
Jim Kiddoo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Script to create folder with time stamp and then move into folder

That works Perfectly, thank you very much.

Jim
"Pegasus (MVP)" <I.can@fly.com> wrote in message
news:ufjaztkNIHA.5988@TK2MSFTNGP02.phx.gbl...
> Try this:
>
> @echo off
> set T=%time:~0,5%
> set dir=%date:/=-% %T::=-%
> echo The target folder is "%dir%".
> xcopy /s /c /y "E:\Main Directory\*.*" "D:\Backup\%dir%\"
>
>
> "Jim Kiddoo" <jim.kiddoo@headcount.com> wrote in message
> news:88BCFCB0-FC70-4278-A18D-931497B126DA@microsoft.com...
>>I need to copy around 50 files into a new directory that is stamped with
>>the current time and date. This needs to be scheduled through the
>>scheduler, so it has to be scripted to run hourly.
>>
>> so every hour a new folder is created with a new name and all the files
>> from the main directory are copied into it. This needs to happen every
>> hour with a unique folder name every time.
>>
>> Thanks for any .
>> Jim
>>
>>
>> "Pegasus (MVP)" <I.can@fly.com> wrote in message
>> news:OsW8IZfNIHA.5988@TK2MSFTNGP02.phx.gbl...
>>>
>>> "Jim Kiddoo" <jim.kiddoo@headcount.com> wrote in message
>>> news:64B9FAD6-6509-4D7E-9F4A-97BDFEEA9EAA@microsoft.com...
>>>> Hello,
>>>> I am trying to script something to creat a folder with the time and
>>>> date inthe name and then copy files into it. I have a set of files i
>>>> want copies of every hour. Due to the way the app was created the files
>>>> do not appear to change since they take a certain size to satrt and
>>>> then data is appended to them so the size does nto change. Backup sees
>>>> that they didnt change so doesnt back them up again.
>>>>
>>>> Any would be apreciated. I have found an applicaiton to create the
>>>> folder with the time and date, but i cant figure out how to copy into
>>>> that folder dynamically. I need to bring the name of the folder created
>>>> by the app into a copy command. I can redirect the output of the create
>>>> into a txt file but how do I read from that to copy into the folder.
>>>> Thanks
>>>> Jim
>>>
>>> What you require is not hard to achieve but you need to give
>>> a detailed example to illustrate your needs.
>>>

>>

>
>


  Réponse avec citation
Vieux 05/12/2007, 06h59   #6
Pegasus \(MVP\)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Script to create folder with time stamp and then move into folder

Thanks for the feedback.


"Jim Kiddoo" <jim.kiddoo@headcount.com> wrote in message
news:F377DED3-A79C-4B98-AFE7-AEC2A84E1D98@microsoft.com...
> That works Perfectly, thank you very much.
>
> Jim
> "Pegasus (MVP)" <I.can@fly.com> wrote in message
> news:ufjaztkNIHA.5988@TK2MSFTNGP02.phx.gbl...
>> Try this:
>>
>> @echo off
>> set T=%time:~0,5%
>> set dir=%date:/=-% %T::=-%
>> echo The target folder is "%dir%".
>> xcopy /s /c /y "E:\Main Directory\*.*" "D:\Backup\%dir%\"
>>
>>
>> "Jim Kiddoo" <jim.kiddoo@headcount.com> wrote in message
>> news:88BCFCB0-FC70-4278-A18D-931497B126DA@microsoft.com...
>>>I need to copy around 50 files into a new directory that is stamped with
>>>the current time and date. This needs to be scheduled through the
>>>scheduler, so it has to be scripted to run hourly.
>>>
>>> so every hour a new folder is created with a new name and all the files
>>> from the main directory are copied into it. This needs to happen every
>>> hour with a unique folder name every time.
>>>
>>> Thanks for any .
>>> Jim
>>>
>>>
>>> "Pegasus (MVP)" <I.can@fly.com> wrote in message
>>> news:OsW8IZfNIHA.5988@TK2MSFTNGP02.phx.gbl...
>>>>
>>>> "Jim Kiddoo" <jim.kiddoo@headcount.com> wrote in message
>>>> news:64B9FAD6-6509-4D7E-9F4A-97BDFEEA9EAA@microsoft.com...
>>>>> Hello,
>>>>> I am trying to script something to creat a folder with the time and
>>>>> date inthe name and then copy files into it. I have a set of files i
>>>>> want copies of every hour. Due to the way the app was created the
>>>>> files do not appear to change since they take a certain size to satrt
>>>>> and then data is appended to them so the size does nto change. Backup
>>>>> sees that they didnt change so doesnt back them up again.
>>>>>
>>>>> Any would be apreciated. I have found an applicaiton to create
>>>>> the folder with the time and date, but i cant figure out how to copy
>>>>> into that folder dynamically. I need to bring the name of the folder
>>>>> created by the app into a copy command. I can redirect the output of
>>>>> the create into a txt file but how do I read from that to copy into
>>>>> the folder.
>>>>> Thanks
>>>>> Jim
>>>>
>>>> What you require is not hard to achieve but you need to give
>>>> a detailed example to illustrate your needs.
>>>>
>>>

>>
>>

>



  Réponse avec citation
Vieux 18/12/2007, 18h01   #7
ajayts1980@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Script to create folder with time stamp and then move into folder

My DOS actually gives the Day also as the output
like Tue 12/18/2007

How can I filter only the date from the output? I do not need the day,
  Réponse avec citation
Vieux 18/12/2007, 21h12   #8
Pegasus \(MVP\)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Script to create folder with time stamp and then move into folder


<ajayts1980@gmail.com> wrote in message
news:888f891b-6dbe-4677-8b67-6b4592d40374@e10g2000prf.googlegroups.com...
> My DOS actually gives the Day also as the output
> like Tue 12/18/2007
>
> How can I filter only the date from the output? I do not need the day,


It is not possible to filter out the day under DOS.
However, you can remove it in a Command Prompt
under Win2000/XP:

set MyDate=%date:~4%
echo Date=%MyDate%


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h48.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,20706 seconds with 16 queries