Sign in to follow this  
Followers 0
Enigma

Automatic Backup of Jumpdrives

1 post in this topic

This is a small program I wrote to automate the backup of any jump drive which is plugged in to a system. Just thought I'd share. :-)

CODE
;

; brdd.au3

;

; Backup Kris's jump drive every day so she can't lose her stuff again.

;

$curDir = @MyDocumentsDir & "\My Backups";

if( not FileExists($curDir) )then

DirCreate( $curDir );

endif

;

; Check to see if the drive is in the computer.

;

while( 1 )

$drives = DriveGetDrive( "REMOVABLE" );

while( $drives[0] < 2 )

sleep( 15000 );

$drives = DriveGetDrive( "REMOVABLE" );

wend

if( DirGetSize($drives[2]) <> DirGetSize($curDir) )then

$curDir = @MyDocumentsDir & "\My Backups\" & _

@mon & "_" & @mday & "_" & @year & "-" & @hour & "_" & @min & "_" & @sec;

DirCreate( $curDir );

DirCopy( $drives[2], $curDir, 1 );

endif

sleep( 15000 );

wend

I hope someone finds this useful. Just put it into your favorite program place and make a new scheduled task. Set the task to start up on login, and never forget to back-up your jumpdrive again. I wrote this because my wife has lost two of her jumpdrives with over a year's worth of tests. (She's a teacher.) So now she can't lose everything ever again! :P

I know it can make a large number of back-up files, but you really aren't supposed to be using a jumpdrive as your main hard drive anyway. :whistle: So I'm hoping it helps my wife to realize this as well. :D Also, if you don't care about keeping jumpdrives separated (ie: If you have six jumpdrives but don't care if each of them gets jumbled together with the other jumpdrives, then you can just take out the hour, minute, and second part of the directory name and everything will be dumped into one directory per day. Unfortunately, this would also mean that the program would be constantly moving files over since it would always see the two directories as being different in size.

Anyway - enjoy! :lmao:

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0