Solved

Nightly Backup of Single File

Posted on 2004-04-21
7
249 Views
Last Modified: 2010-04-13
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.
0
Comment
Question by:H4Inf
  • 4
  • 3
7 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
Comment Utility
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
 

Author Comment

by:H4Inf
Comment Utility
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
 

Author Comment

by:H4Inf
Comment Utility
There is a space after Thu, perhaps this is the issue? How do I remedy it.

Paul.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:H4Inf
Comment Utility
Ok I got it ;-) Thanks!
0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
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
 

Author Comment

by:H4Inf
Comment Utility
@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
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now