H4Inf
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.
Thanks,
Paul.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
There is a space after Thu, perhaps this is the issue? How do I remedy it.
Paul.
Paul.
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
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
ASKER
@for /f "tokens=1-3 delims=/" %%a in ("%date%") do copy c:\MySource\filmsd.mde "C:\MyDestination\filmsd-% %a%%b%%c.m de"
Just added the quotes around the destination file. =)
Paul.
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...
The last adjustment will exclude it (and you can exclude the quotes) if you're interested...
ASKER
C:\BACKUP>copy c:\films\filmsd.mde C:\backup\films\filmsd-Thu
The syntax of the command is incorrect.