PC Review


Reply
Thread Tools Rate Thread

Copy past 7 days of folders

 
 
=?Utf-8?B?Sm9obkgtTW8=?=
Guest
Posts: n/a
 
      24th Jan 2005
I backup a folder each night from A to B and once a week wish to offload
those 7 folders to a second location. I have tried robocopy with the /maxage
param, but that affects files not folders. The command I tried was:
robocopy d:\laptop\ /s d:\Weeklytemp /maxage:7.

Does anyone have any other ideas? I guess I could learn how to pass a
date-7 type of parameter if someone could suggest a good website that
discusses how to do that.

Thanks in advance.
 
Reply With Quote
 
 
 
 
Jerold Schulman
Guest
Posts: n/a
 
      25th Jan 2005
On Mon, 24 Jan 2005 09:47:01 -0800, "JohnH-Mo" <(E-Mail Removed)> wrote:

>I backup a folder each night from A to B and once a week wish to offload
>those 7 folders to a second location. I have tried robocopy with the /maxage
>param, but that affects files not folders. The command I tried was:
>robocopy d:\laptop\ /s d:\Weeklytemp /maxage:7.
>
>Does anyone have any other ideas? I guess I could learn how to pass a
>date-7 type of parameter if someone could suggest a good website that
>discusses how to do that.
>
>Thanks in advance.



Using DatePorM.bat from tip 8293 in the 'Tips & Tricks' at http://www.jsiinc.com

@echo off
setlocal ENABLEDELAYEDEXPANSION
call DatePorM -8 Since
set syyyymmdd=%since:~6,4%%since:~0,2%%since:~3,2%
for /f "Tokens=1,4" %%d in ('dir d:\laptop /AD /TC^|FIND "/"') do (
set dt=%%d
set this=!dt:~6,4!!dt:~0,2!!dt:~3,2!
@echo if "!this!" GEQ "%syyyymmdd%" robocopy "d:\laptop\%%e" /s "d:\weeklytemp\%%e"
)

If your date format is NOT MM/DD/YYYY, you will have to adjust the above.




Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
X out days in the past =?Utf-8?B?ZGFya2dyYWNl?= Microsoft Outlook Calendar 2 16th May 2007 07:36 AM
Does anyone ever look past the first few days Henry Jones Windows Vista General Discussion 55 23rd Jan 2007 01:43 PM
Re: how do i show the difference between past days and furture days? Brian Tillman Microsoft Outlook Calendar 0 6th Jan 2007 02:27 AM
I wish MS would add the days past and days remaining of the year. =?Utf-8?B?RFZBTEVOVElORQ==?= Microsoft Outlook Calendar 2 14th Jun 2006 01:07 AM
days remaining and days that have past Michael Microsoft Access 3 24th Jun 2005 04:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:34 AM.