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.
H4InfAsked:
Who is Participating?
 
sirbountyConnect With a Mentor Commented:
This should do it...

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

Then, use Task Scheduler in Control Panel to schedule it nightly...
0
 
H4InfAuthor Commented:
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.
0
 
H4InfAuthor Commented:
There is a space after Thu, perhaps this is the issue? How do I remedy it.

Paul.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
H4InfAuthor Commented:
Ok I got it ;-) Thanks!
0
 
sirbountyCommented:
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
0
 
H4InfAuthor Commented:
@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.
0
 
sirbountyCommented:
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...
0
All Courses

From novice to tech pro — start learning today.