Link to home
Start Free TrialLog in
Avatar of metamatic
metamatic

asked on

Auotmatically generating a folder name with robocopy

I am using robocopy via a one line batch file and Task Scheduler to backup a folder on one server to a removable hard disk that is on a different server. The disk is large, my backup quite small and i often need to refer back to previous days so don't see the harm in creating a new folder each time rather than overwrite the exsiting one.

Ideally I would like to auto generate a folder on the removavble disk based on today's date and then have robocopy backup to this.

Can aybody let me know whether there are any switches in robocopy that will let me do this or whether there is something else i can add to my batch file to do it?
ASKER CERTIFIED SOLUTION
Avatar of Rob Stone
Rob Stone
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of metamatic
metamatic

ASKER

Nice one, tweaked it a bit and it works fine.

However, just got a one final query....

The backup runs at 6am but i would like it to be dated the previous day. Can you let me know how I can roll it back a day. (i assume i have to insert a "-1" in there somewhere!)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial