Solved

How create script to backup 2 files to jump drive

Posted on 2012-03-26
4
283 Views
Last Modified: 2012-03-28
I have two files that I manually backup daily to a jump drive.  I'd like to write a script to do this by double-clicking an icon on my desktop but don't know how to do it.  I am using Windows 7.

One of the files is located at:
\\ServerName\FolderName\SubFolderName\FileName.mdb

and the other one is located at:
\\SameServerName\ADifferentFolderName\ADifferentSubFolderName\FileName.mdb

I want then both to backup to a folder on the jump drive named:
FileBackups

I'm new at this.  How can I accomplish this?

--Steve
0
Comment
Question by:SteveL13
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Geodash
ID: 37768117
an easy script would override the previous days backups.

Do you want to keep more than the previous days, or is it safe to backup only the previous days?
0
 
LVL 9

Accepted Solution

by:
Frank McCourry earned 500 total points
ID: 37768123
A simple batch file can accomplish this.  Be careful to insert your thumb drive in the same usb port every time, to avoid getting a different drive letter:

1. Create a text file and paste in the following, making adjustments for you environment:
========================================================================
xcopy \\ServerName\FolderName\SubFolderName\FileName.mdb f:\FileBackups /h /e /c/ k /y /f
xcopy \\SameServerName\ADifferentFolderName\ADifferentSubFolderName\FileName.mdb f:\FileBackups  /h /e /c/ k /y /f
========================================================================
2. save the text file as "backup.bat" or something similar.  the .bat is important.

This is assuming that your thumb drive is getting drive letter F:

I use xcopy because of the rich features and control.  This script is written as simply as possible and will overwrite any files on the destination with the same filename without warning.

For more info on xcopy, go to a command prompt and type xcopy /?
0
 

Author Comment

by:SteveL13
ID: 37774130
Hmmm.. is not working.  I double-click the .bat file and nothing gets written to the drive (drive e for my system).
0
 
LVL 9

Expert Comment

by:Frank McCourry
ID: 37774179
Make sure the drive or the folder is not write protected.  Also check that you have appropriate permissions.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

First some basics on Windows 7 Backup.  It has 2 components one is a file based backup which is stored in .zip files each zip is split at around 200 Megabytes and there is the Image Backup which is as the name implies a total image of the partition …
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

911 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

22 Experts available now in Live!

Get 1:1 Help Now