Discussion:
Support Script Robocopy
(too old to reply)
Miguel
2009-09-15 19:03:56 UTC
Permalink
Hi!.
I have a script with robocopy as follows:
robocopy.exe source destination /MIR /SEC /CopyAll /V /TEE /B /MAXAGE:1 /W:5
/R:1

running at 00.01h and copy the modified files to another folder, then run
the wzzip.exe and taking them to another location via FTP.

Now I have to perform the same operation, but at 20.00h, and I need a
different folder, ONLY 0.00-20.00 modified files from the same day.

As I do?
Pegasus [MVP]
2009-09-15 20:48:11 UTC
Permalink
Post by Miguel
Hi!.
robocopy.exe source destination /MIR /SEC /CopyAll /V /TEE /B /MAXAGE:1
/W:5 /R:1
running at 00.01h and copy the modified files to another folder, then run
the wzzip.exe and taking them to another location via FTP.
Now I have to perform the same operation, but at 20.00h, and I need a
different folder, ONLY 0.00-20.00 modified files from the same day.
As I do?
Use the /maxage:1 switch.
Miguel
2009-09-16 07:12:47 UTC
Permalink
But this option brings the modified files also the day before.
What I need is for example.

Day: 16-09-2009.
ONLY synchronize files to other folder modified 16-09-2009 day from 00.00
until at 20.00h
Post by Pegasus [MVP]
Post by Miguel
Hi!.
robocopy.exe source destination /MIR /SEC /CopyAll /V /TEE /B /MAXAGE:1
/W:5 /R:1
running at 00.01h and copy the modified files to another folder, then run
the wzzip.exe and taking them to another location via FTP.
Now I have to perform the same operation, but at 20.00h, and I need a
different folder, ONLY 0.00-20.00 modified files from the same day.
As I do?
Use the /maxage:1 switch.
Pegasus [MVP]
2009-09-16 07:49:53 UTC
Permalink
Below is the full log of the test I ran before I posted my reply:

Directory of D:\Tue
Tue 15/09/2009 09:45 108 sub.txt
Wed 16/09/2009 09:44 2,275 set.txt

robocopy d:\tue d:\tue1 *.* /maxage:1

Directory of D:\Tue1
Wed 16/09/2009 09:44 2,275 set.txt

I suggest you run a similar test, then post the result here in support of
your claim.
Post by Miguel
But this option brings the modified files also the day before.
What I need is for example.
Day: 16-09-2009.
ONLY synchronize files to other folder modified 16-09-2009 day from 00.00
until at 20.00h
Post by Pegasus [MVP]
Post by Miguel
Hi!.
robocopy.exe source destination /MIR /SEC /CopyAll /V /TEE /B /MAXAGE:1
/W:5 /R:1
running at 00.01h and copy the modified files to another folder, then
run the wzzip.exe and taking them to another location via FTP.
Now I have to perform the same operation, but at 20.00h, and I need a
different folder, ONLY 0.00-20.00 modified files from the same day.
As I do?
Use the /maxage:1 switch.
Miguel
2009-09-16 11:36:52 UTC
Permalink
Directory: Source
bus.xml 14/09/2009 09.00
street.xml 15/09/2009 15:00
car.xml 16/09/2009 11:00

Directory: Destination
street.xml 15/09/2009 15:00
car.xml 16/09/2009 11:00

robocopy Source Destination *.* /e /W:5 /R:1 /MAXAGE:1 --> executed to:
16/09/2009 12:00
Post by Pegasus [MVP]
Directory of D:\Tue
Tue 15/09/2009 09:45 108 sub.txt
Wed 16/09/2009 09:44 2,275 set.txt
robocopy d:\tue d:\tue1 *.* /maxage:1
Directory of D:\Tue1
Wed 16/09/2009 09:44 2,275 set.txt
I suggest you run a similar test, then post the result here in support of
your claim.
Post by Miguel
But this option brings the modified files also the day before.
What I need is for example.
Day: 16-09-2009.
ONLY synchronize files to other folder modified 16-09-2009 day from 00.00
until at 20.00h
Post by Pegasus [MVP]
Post by Miguel
Hi!.
robocopy.exe source destination /MIR /SEC /CopyAll /V /TEE /B /MAXAGE:1
/W:5 /R:1
running at 00.01h and copy the modified files to another folder, then
run the wzzip.exe and taking them to another location via FTP.
Now I have to perform the same operation, but at 20.00h, and I need a
different folder, ONLY 0.00-20.00 modified files from the same day.
As I do?
Use the /maxage:1 switch.
Pegasus [MVP]
2009-09-16 12:02:56 UTC
Permalink
Perhaps we use different versions of robocopy. Here are the details of my
copy:
---------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
---------------------------------------------------------------------
Post by Miguel
Directory: Source
bus.xml 14/09/2009 09.00
street.xml 15/09/2009 15:00
car.xml 16/09/2009 11:00
Directory: Destination
street.xml 15/09/2009 15:00
car.xml 16/09/2009 11:00
16/09/2009 12:00
Post by Pegasus [MVP]
Directory of D:\Tue
Tue 15/09/2009 09:45 108 sub.txt
Wed 16/09/2009 09:44 2,275 set.txt
robocopy d:\tue d:\tue1 *.* /maxage:1
Directory of D:\Tue1
Wed 16/09/2009 09:44 2,275 set.txt
I suggest you run a similar test, then post the result here in support of
your claim.
Post by Miguel
But this option brings the modified files also the day before.
What I need is for example.
Day: 16-09-2009.
ONLY synchronize files to other folder modified 16-09-2009 day from
00.00 until at 20.00h
Post by Pegasus [MVP]
Post by Miguel
Hi!.
robocopy.exe source destination /MIR /SEC /CopyAll /V /TEE /B
/MAXAGE:1 /W:5 /R:1
running at 00.01h and copy the modified files to another folder, then
run the wzzip.exe and taking them to another location via FTP.
Now I have to perform the same operation, but at 20.00h, and I need a
different folder, ONLY 0.00-20.00 modified files from the same day.
As I do?
Use the /maxage:1 switch.
Miguel
2009-09-16 13:42:40 UTC
Permalink
-----------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
-----------------------------------------------------------------------------
Post by Pegasus [MVP]
Perhaps we use different versions of robocopy. Here are the details of my
---------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
---------------------------------------------------------------------
Post by Miguel
Directory: Source
bus.xml 14/09/2009 09.00
street.xml 15/09/2009 15:00
car.xml 16/09/2009 11:00
Directory: Destination
street.xml 15/09/2009 15:00
car.xml 16/09/2009 11:00
16/09/2009 12:00
Post by Pegasus [MVP]
Directory of D:\Tue
Tue 15/09/2009 09:45 108 sub.txt
Wed 16/09/2009 09:44 2,275 set.txt
robocopy d:\tue d:\tue1 *.* /maxage:1
Directory of D:\Tue1
Wed 16/09/2009 09:44 2,275 set.txt
I suggest you run a similar test, then post the result here in support
of your claim.
Post by Miguel
But this option brings the modified files also the day before.
What I need is for example.
Day: 16-09-2009.
ONLY synchronize files to other folder modified 16-09-2009 day from
00.00 until at 20.00h
Post by Pegasus [MVP]
Post by Miguel
Hi!.
robocopy.exe source destination /MIR /SEC /CopyAll /V /TEE /B
/MAXAGE:1 /W:5 /R:1
running at 00.01h and copy the modified files to another folder, then
run the wzzip.exe and taking them to another location via FTP.
Now I have to perform the same operation, but at 20.00h, and I need a
different folder, ONLY 0.00-20.00 modified files from the same day.
As I do?
Use the /maxage:1 switch.
Pegasus [MVP]
2009-09-16 17:15:48 UTC
Permalink
The only suggestion I can make is for you to examine your file dates in more
detail. On my machine the default appears to imply the /tw switch for the
"dir" command. Perhaps your machine uses /tc or /ta. This would explain the
discrepancy between robocopy.exe and the "dir" command.
Post by Miguel
-----------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
-----------------------------------------------------------------------------
Post by Pegasus [MVP]
Perhaps we use different versions of robocopy. Here are the details of my
---------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
---------------------------------------------------------------------
Post by Miguel
Directory: Source
bus.xml 14/09/2009 09.00
street.xml 15/09/2009 15:00
car.xml 16/09/2009 11:00
Directory: Destination
street.xml 15/09/2009 15:00
car.xml 16/09/2009 11:00
16/09/2009 12:00
Post by Pegasus [MVP]
Directory of D:\Tue
Tue 15/09/2009 09:45 108 sub.txt
Wed 16/09/2009 09:44 2,275 set.txt
robocopy d:\tue d:\tue1 *.* /maxage:1
Directory of D:\Tue1
Wed 16/09/2009 09:44 2,275 set.txt
I suggest you run a similar test, then post the result here in support
of your claim.
Post by Miguel
But this option brings the modified files also the day before.
What I need is for example.
Day: 16-09-2009.
ONLY synchronize files to other folder modified 16-09-2009 day from
00.00 until at 20.00h
Post by Pegasus [MVP]
Post by Miguel
Hi!.
robocopy.exe source destination /MIR /SEC /CopyAll /V /TEE /B
/MAXAGE:1 /W:5 /R:1
running at 00.01h and copy the modified files to another folder,
then run the wzzip.exe and taking them to another location via FTP.
Now I have to perform the same operation, but at 20.00h, and I need
a different folder, ONLY 0.00-20.00 modified files from the same
day.
As I do?
Use the /maxage:1 switch.
Miguel
2009-09-16 18:41:49 UTC
Permalink
DIR /TC and /TW

car.xml 16/09/2009 11:00

DIR /TA

street.xml 15/09/2009 15:00
car.xml 16/09/2009 11:00
Post by Pegasus [MVP]
The only suggestion I can make is for you to examine your file dates in
more detail. On my machine the default appears to imply the /tw switch for
the "dir" command. Perhaps your machine uses /tc or /ta. This would
explain the discrepancy between robocopy.exe and the "dir" command.
Post by Miguel
-----------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
-----------------------------------------------------------------------------
Post by Pegasus [MVP]
Perhaps we use different versions of robocopy. Here are the details of
---------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
---------------------------------------------------------------------
Post by Miguel
Directory: Source
bus.xml 14/09/2009 09.00
street.xml 15/09/2009 15:00
car.xml 16/09/2009 11:00
Directory: Destination
street.xml 15/09/2009 15:00
car.xml 16/09/2009 11:00
16/09/2009 12:00
Post by Pegasus [MVP]
Directory of D:\Tue
Tue 15/09/2009 09:45 108 sub.txt
Wed 16/09/2009 09:44 2,275 set.txt
robocopy d:\tue d:\tue1 *.* /maxage:1
Directory of D:\Tue1
Wed 16/09/2009 09:44 2,275 set.txt
I suggest you run a similar test, then post the result here in support
of your claim.
Post by Miguel
But this option brings the modified files also the day before.
What I need is for example.
Day: 16-09-2009.
ONLY synchronize files to other folder modified 16-09-2009 day from
00.00 until at 20.00h
Post by Pegasus [MVP]
Post by Miguel
Hi!.
robocopy.exe source destination /MIR /SEC /CopyAll /V /TEE /B
/MAXAGE:1 /W:5 /R:1
running at 00.01h and copy the modified files to another folder,
then run the wzzip.exe and taking them to another location via FTP.
Now I have to perform the same operation, but at 20.00h, and I need
a different folder, ONLY 0.00-20.00 modified files from the same
day.
As I do?
Use the /maxage:1 switch.
Pegasus [MVP]
2009-09-16 19:14:17 UTC
Permalink
As I said before, I have no further explanations for the difference in
behaviour of robocopy.exe. I can see these options for you:
a) Live with the problem.
b) Investigate robocopy.exe in more detail, e.g. by using different values
for the /maxage parameter and by running the command on different machines
with different operating systems and different files.
c) Write your own recursive VB Script code and make it date-sensitive.
d) Use a different copy tool, e.g. xcopy.exe or xxcopy.exe.
Post by Miguel
DIR /TC and /TW
car.xml 16/09/2009 11:00
DIR /TA
street.xml 15/09/2009 15:00
car.xml 16/09/2009 11:00
Loading...