Link to home
Start Free TrialLog in
Avatar of H4Inf
H4InfFlag for Australia

asked on

Nightly Backup of Single File

I need to do a nightly backup of a single file. This file needs to be dated and perhaps renamed with the date in it, or placed in a folder named the date. Filename 'filmsd.mde'. I was thinking perhaps a batch file would do...

Thanks,

Paul.
ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America 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 H4Inf

ASKER

C:\BACKUP>backup_sen

C:\BACKUP>copy c:\films\filmsd.mde C:\backup\films\filmsd-Thu 04222004.mde
The syntax of the command is incorrect.
Avatar of H4Inf

ASKER

There is a space after Thu, perhaps this is the issue? How do I remedy it.

Paul.
Avatar of H4Inf

ASKER

Ok I got it ;-) Thanks!
How'd you clear it?
If your version displays the day, you can adjust tokens to equal 2-4 and delims to equal "/" with a trailing {space}
Glad you got it working though.  Thanx. :D
Avatar of H4Inf

ASKER

@for /f "tokens=1-3 delims=/" %%a in ("%date%") do copy c:\MySource\filmsd.mde "C:\MyDestination\filmsd-%%a%%b%%c.mde"

Just added the quotes around the destination file. =)

Paul.
Okay - so you're including the 'day' part of the date...
The last adjustment will exclude it (and you can exclude the quotes) if you're interested...