• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 296
  • Last Modified:

How create script to backup 2 files to jump drive

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
SteveL13
Asked:
SteveL13
  • 2
1 Solution
 
GeodashCommented:
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
 
Frank McCourryV.P. Holland Computers, Inc.Commented:
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
 
SteveL13Author Commented:
Hmmm.. is not working.  I double-click the .bat file and nothing gets written to the drive (drive e for my system).
0
 
Frank McCourryV.P. Holland Computers, Inc.Commented:
Make sure the drive or the folder is not write protected.  Also check that you have appropriate permissions.
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now