Solved

How create script to backup 2 files to jump drive

Posted on 2012-03-26
4
287 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

808 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