| Author |
Topic |
|
ds12will
Starting Member
21 Posts |
Posted - 2009-12-03 : 15:06:16
|
| In a SQL job I'm putting a command to copy files from one area to another. In the command, it's copying all log files....see example below:mput W:\log\*.logIs there a way to have it copy files modified within the last day in the command?I haven't really used command prompts before and don't think you can really use if statements. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
ds12will
Starting Member
21 Posts |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
ds12will
Starting Member
21 Posts |
Posted - 2009-12-03 : 15:55:45
|
quote: Originally posted by X002548 fine...But I still have a problem with what you are doingSo what you are saying is...that if a file "appears" to be modified...this is meant to drive your process?Good LuckBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam
yikes...Basically it will transfer log files from one location to another and I don't want to copy large files that only get updated once a month.So by having something in the command say "hey this file was last modified less than 24 hours ago lets copy it over" |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2009-12-03 : 16:10:40
|
The free Windows resource kit ROBOCOPY command is a very good tool for this, even to copy files over a WAN.Mirror source share to target share for files with a max age of 2 days.ROBOCOPY \\sourceserver\sourceshare \\targetserver\targetshare *.* /COPY:DAT /MIR /MAXAGE:2 /R:10 /W:30 /Z /NP CODO ERGO SUM |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
ds12will
Starting Member
21 Posts |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
tripodal
Constraint Violating Yak Guru
259 Posts |
Posted - 2009-12-03 : 17:01:08
|
| xcopy has a switch for copying files modified on or after a specified date. there are a lot of ways to do what you ask. What exactly are you intending as your final goal? 2 copies of all of these files? incremental backup, script to help generate debugging info? |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2009-12-03 : 19:08:53
|
| [Pet Detective]Alrighty Then[/Pet Detective]THE problem....is that you can have file that's OUT THERE.......FOREVER....and you never deal with it, and IF you MISS it AND it's NEVER been touched.....then it'll stay thereBut Hey, that's just me.Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
 |
|
|
|