Jump to content
Light-O-Rama Forums

Easy backup script


Dave Batzdorf

Recommended Posts

I posted this on PC and figured I would post here too.

 

here is an easy backup script that I wrote to automate my Christmas files backup.

 

robocopy D:\christmas\2013 j:\ /e /mir

 

1.  Open Note Pad and copy the above routine.

2.  D:\christmas 2013 = the source directory where your LOR and audio files are.  Normally the hard drive is "c", but I have a different type of PC cinfig.

3.  j:\ = the flash drive letter.

4.  /e = copy all sub-folders, even empty ones
5.  /mir = mirror (check the files in the destination, and only copy newer files)

 

When you are done with the script, save it as "Backup.bat" and place it on your desktop for easy access.

 

this little routine works really well and fast.  The first time takes a few seconds as it needs to copy everything in the source folder.  But after that it will only copy what has been changed.

 

If you have any other questions or concerns, let me know and I'll give you a hand, or someone else will chime in!

Link to comment
Share on other sites

Thanks!  I've been looking for a way to do this myself.   I like to copy files between several computers and now I'll be able to just copy only the newest files instead of every single file in every directory every time.

 

Do you know if this can be modified to do it across a home network system?  

 

Then all I would have to do is run the script and have it copy my files to the other systems from the main computer I create the new/edited/updated sequences on.

Link to comment
Share on other sites

Dave,

Very nice of you to share!

 

Orville,

Have you considered using dropbox? I run a bat file like above and back it up to my dropbox folder on my PC which is now available on all PCs I have dropbox installed on and is now in the cloud so they are available in case of some catastrophic failure of PC or worse home.

Otherwise you might try mapping the other PC drives to yours, since windows sees it as a drive on your PC it might just copy them, (I have not tried this)

 

You can also have this backup automatically by putting the backup.bat in windows programs startup or by using windows scheduler and set it for any specific time you want.

In case you don't know how here are a couple sites

W7

http://stackoverflow.com/questions/11019792/how-to-run-a-bat-file-at-specified-day-time

XP

http://www.computerhope.com/issues/ch000785.htm

 

One thing, robocopy will not copy if a file is open in the folder, it will hang there until you close the file.

hobocopy will copy files in use but you have to install a little program for it

http://coolthingoftheday.blogspot.com/2011/01/hobocopy-comes-back-to-life-hobocopy-is.html

Link to comment
Share on other sites

I posted this on PC and figured I would post here too.

 

here is an easy backup script that I wrote to automate my Christmas files backup.

 

robocopy D:\christmas\2013 j:\ /e /mir

 

1.  Open Note Pad and copy the above routine.

2.  D:\christmas 2013 = the source directory where your LOR and audio files are.  Normally the hard drive is "c", but I have a different type of PC cinfig.

3.  j:\ = the flash drive letter.

4.  /e = copy all sub-folders, even empty ones

5.  /mir = mirror (check the files in the destination, and only copy newer files)

 

When you are done with the script, save it as "Backup.bat" and place it on your desktop for easy access.

 

this little routine works really well and fast.  The first time takes a few seconds as it needs to copy everything in the source folder.  But after that it will only copy what has been changed.

 

If you have any other questions or concerns, let me know and I'll give you a hand, or someone else will chime in!

 

I use Robocopy a lot at work.

 

Just one thing to be aware of - by default, robocopy will only copy new(er) files. the /mir option "mirrors" the source to the destination. It will DELETE files in the destination if they are not in the source!

 

So for example, if you accidentally lost some files in your source (D:\christmas\2013) and you ran this script it would DELETE those same files in the destination (j:\), probably before you had a chance to notice they were missing!!

 

What I would do is omit the /mir option. It will still only copy newer and brand new files to the destination but it won't delete any files. If you are SURE all the files are in the source then occasionally run it with the /mir option.

 

Trust me, I have lost a lot of data very quickly by using the /mir option.

 

TonyD

Link to comment
Share on other sites

Thanks!  I've been looking for a way to do this myself.   I like to copy files between several computers and now I'll be able to just copy only the newest files instead of every single file in every directory every time.

 

Do you know if this can be modified to do it across a home network system?  

 

Then all I would have to do is run the script and have it copy my files to the other systems from the main computer I create the new/edited/updated sequences on.

 

Yes.  It will copy across the net if you have your destination PC mapped.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...