shrum.net :: Code :: Copy2MSC

|
Copy2MSC
|
| Copy2MSC is a
open-source automatic backup tool tailored for removable storage devices
such as USB flash drives, external hard drives, etc. Ultimately, this
can be used with any MSC-compliant device including Firewire devices
which are also MSC-compliant. This app really shines when dealing with
large amounts of files that get updated all over the place. |
| |
Copy2MSC is a automated
backup utility tailored toward use with MSC (Mass Storage Class)
compliant devices such as USB and Firewire drives and flash devices.
All you need to do (after the initial setup) is just plug in your
external USB or FIREWIRE device and Copy2MSC
automatically launches and backs up your defined folders and files to it
based on one of 4 timestamp conditions:
- Monthly
- 30 days after the last backup
- Weekly
- 7 days after the last backup
- Daily
- 24 hours after the last backup
- Everytime
- every time the device is plugged in or one of the above scheduled
backups is run
Copy2MSC is designed to do accumulative,
incremental-style backups; thus skipping files where the timestamp
and file size are unchanged. Only new or updated files get transferred.
Copy2MSC also deals with filename wildcards and subfolder traversals so
calls like "c:\*.doc" will ensure you get EVERY doc file on your
C drive.
It's Windows-based, open source (GNU),
and solely written, maintained, hosted, and supported by me, Sean Shrum. Source code is written with
AutoIT (.au3) and the
most recent version can be found via the source link in the navbar above. If you're just looking for the latest binary build, it can be downloaded from
the binary link in the navbar above.
I've been in the computer field for over 15 years and you'd think I'd know
better. I usually keep a backup of everything I work on but one day, while
shifting through all my backups I decided to "clean-up", "centralize", and
"organize". Well, in the mist of my "organization", I blew away a weeks worth of
deeeeep coding. Oh, I was pissed but a bit relieved that all my other
data was still somewhere in the mess I called my backups
In addition, I use a program called WebDrive that allows me to define mapped
drives in Windows to FTP sites (such as my own site). This allows me to use any
application as a web-development tool. Any program can now load and save files
directly to my website. However, because I edit directly to the site, there is
only 1 copy of the files I have. If I screw something up or my server's H/D
dies, I'm back to square one (trust me, it happens). :-p
I currently own two 1 gig and one 512 meg flash disks and they're not enough
to hold the irreplaceable data that I've created (this website alone is over 1.5
gigs). A client of mine showed me a laptop drive that powered off the USB cable
(my only holdout was that external drive housings required an additional
external power adapter). I picked up a X-Drive housing for $11 (which ironically
enough is my 'X' drive for 'eXternal') and a 60 gig Toshiba 2.5-inch drive for
$100. I could now save large amounts of data. I just didn't have any backup
software.
I looked for a open-source solution and found none (granted, my search really
was quite short). Commercial products abound...for a price. Being under-paid and
ever-resourceful, I took some of the code that I used to create my Shuffler
application for randomly moving files to MSC-compliant devices and tweaked it a
bit to deal with full-folder file transfers. This gained me the same convenience
my Shuffler app brought me: I simply plug the USB drive in and the backup starts
by itself. Folder specification is via a text file...it seems simple enough.
First run under each
user profile will cause Copy2MSC to walk the user through initial setup
of destination folder selection and file list build. Below is a
sample of the content in a file list:
Copy2MSC.txt
==========================
[Monthly]
c:\Documents and settings\*.pst
[Weekly]
s:\*.*
[Daily]
c:\*.doc
c:\*.xls
c:\*.mdb
c:\*.ppt
[Everytime]
k:\data\shrum.net\code\copy2msc\*.*
==========================
Once completed, Copy2MSC will run as a
SysTray application and will (if selected) launch at startup and
activate anytime the monitored MSC device
is connected to the PC or when a
scheduled event is triggered.
Right clicking on the SysTray menu icon will produce the
popup menu. From here you can define the destination drive, view the
last log file, force a backup, view the last backup timestamps, etc.
When you plug in a MSC-compliant device, Windows assigns
that device a drive letter. Usually it's the next unused, available
drive letter but there are ways to have Windows
assign the same drive letter each time to a specific device. This
is important to note as Copy2MSC monitors for READY (plugged in) / NOT
READY (not plugged in) status by drive letter.
Once the monitored drive letter reports READY, Copy2MSC does the
following:
- 15-second, opt out dialog (auto start without user interaction)
- Command BEFORE launch (exe, com, pif, or bat)
- File list parsing (wildcards excepted)
- Filename retrieval from defined folders
- File existence / timestamp check / file size check
- File copy (if needed)
- Log file creation (to local and destination drives)
- Command AFTER launch (exe, com, pif, or bat)
Note that no where in the above steps was there any
mention of file deletion. If you delete a file from your
production PC, Copy2MSC WILL NOT remove it from your backup...this
is by design. I did realize that over time, this would create a lot
of 'orphaned files' and for this, I added an option called "Purge
destination". This option will completely delete your backup and prompt
you to run a fresh full backup after the purge completes. A bit
overkill, yes, I'll admit, but an easy task to code for. Some people
may never want to purge their backup and that's fine too.
Q. Can multiple users use Copy2MSC?
Yes, as long as each user has their own Windows login and is
logged in as such. Copy2MSC stores its information to *active* user
profile folder (specifically below the 'Application data' folder).
This means that as long as the user is logged in, Copy2MSC can store
his/her settings to their profile area. Copy2MSC will not be a
solution if you and another user share the same profile (like a
generic account that never logs out) as it will only be able to deal
with 1 profile setting; 1 login = 1 settings file.
Q. Can I use Firewire devices? What about other types of
storage?
Yes. Technically you can use anything that reports back a drive
letter. Copy2MSC monitors the destination drive you define for
READY/NOT READY status. As long as Windows assigns it a drive
letter when it's plugged in and un-assigns the drive letter when you
remove the device, you should be able to use Copy2MSC successfully.
Q. Can I setup Copy2MSC to backup to multiple MSC devices?
No. Copy2MSC monitors for a specific drive letter, not devices.
If you have multiple devices that get assigned the same drive
letter, the same backup will be performed. If you need this type of
functionality,
you can make a request on the
Support
page and I may pursue this as a feature in the next
version.
Q. Can I backup different systems to the same MSC device?
Yes. I recommend creating a top level folder called 'Backups' and
then creating folders beneath that for each system you plan to
backup; '\Backups\Home', '\Backups\Work', etc. You can then use
Copy2MSC's 'Set destination' menu option to define the folder you
want the backup saved to. This way, backups don't get thrown
together in the chance that you have similar directory structures on
the various PCs. Remember to keep an eye on your available disk
space though...
Q. How do I make Windows assign the same drive letter to my
device each time I plug it in?
Take a look at this article for details on getting Windows
95/98/Me/2K/XP to 'reserve' a drive letter for your device.
Q. I'm seeing "Silly rabbit, Copy2MSC is for 'removable' devices
only"
I originally had coded Copy2MSC to test to see if the destination
device was a 'removable' drive. Since then, I've had reports
(including seeing the issue myself) that either Windows or AutoIT
was incorrectly reporting 'removable' devices as 'fixed'. Download
the latest version of Copy2MSC as this check has been removed
(reluctantly, of course).
Q. Can I backup data on my flash disk/external hard drive/etc to
the same disk.
Yes. In fact this is one of the reasons I made Copy2MSC. Just
always make sure you have enough room to store the data. Simply
define the folder and file specification that you want to copy with
into the
file list.
Q. Is there a way to do compression on a finished backup?
Yes. Starting with v2.09, I've added a BEFORE and AFTER command
launcher. You can now define a direct program call or a batch file
call to archive your data. This way, you can use
WinZip,
7zip, or whatever
other tools you like as well as doing things like emailing backup
reports (using something like
BLAT to handle
command line email sending). Here's
one example of a batch file that I run AFTER Copy2MSC completes
a backup.
Q. Is there a forum to talk about enhancements and bugs.
Yes. Enhancement requests and bug reports should go to me
directly using the links on the
Support page. However, there is
a thread on the AutoITScript site I started to announce the app
that can be used for general discussion.
Q. Can I run Copy2MSC and
Shuffler
at the same time to the same device?
Yes. Some people (myself included) like to carry important files
with them all the time (resume, comic book collection list, super
secret file on JFK assassination, GPS file to pirate booty, etc.).
Although Shuffler is meant for MSC DAPs, you can still use Copy2MSC
to store data files to the same device.
Q. When I compile, I get warnings about 'TrayItemSetState' and 'TraySetToolTip'.
Since Copy2MSC was built using some of the new beta features,
you'll need to compile it with the beta version ergo the
syntax/function checker is a bit behind and lacks understanding for
these functions (although they do work). It's not unusual to see
messages like these as the syntax/function checker is usually out of
date. You can safely ignore these messages for now and continue with
the compile (unless of course it's a coding error, but if so it
would be in your copy, not my posted copy). Make sure you have the
latest
beta version of AutoIT.
Q. What version
of AutoIT are you using to build your binaries??
I always grab the latest
beta version of AutoIT before I build. If
I run into problems caused by a specific version of
AutoIT, I'll post such in the release notes.