Approve the Cookies
This website uses cookies to improve your user experience. By using this site, you agree to our use of cookies and our Privacy Policy.
OK
Forums  •   • New posts  •   • RTAT  •   • 'Best of'  •   • Gallery  •   • Gear
Guest
Forums  •   • New posts  •   • RTAT  •   • 'Best of'  •   • Gallery  •   • Gear
Register to forums    Log in

 
POTN forums are closing 31.12.2023. Please see https://photography-on-the.net/forum/showthread.php?t=1530921 and other posts in that thread for details.
FORUMS Post Processing, Marketing & Presenting Photos RAW, Post Processing & Printing 
Thread started 02 Apr 2006 (Sunday) 05:26
Search threadPrev/next
sponsored links (only for non-logged)

How to automate backups using Robocopy

 
lost
Goldmember
Avatar
1,009 posts
Joined Jan 2005
Location: Houma, LA
     
Apr 02, 2006 05:26 |  #1

This is my first guide so please help me by providing feedback.

Background

I see a lot of threads about backups. The simple truth of the matter is that unless its automated it wont get done on a regular basis. (at least for me :lol: ) So i decided to investigate options for automated backup.

I immediately ruled out CD/DVD backups due to size limitations of the media. My requirements at the time consisted of 30GB of photos and 10GB video. (Which has expanded rapidly since that time)

My goal for this project was to protect against drive failure.

I began to research software programs specifically designed for backups but they all fell short on one key requirement, that it be free. I decided to try an app that I use at work frequently for large directory transfers. Robocopy was developed by Microsoft and is distributed free of charge withing the Windows Server 2003 Resource Kit.

Install-Configuration

Don't worry, it will run on almost any version of windows. Go to this website. (external link) and download the resource kit it is around 11mb so if your on Dial Up grab some dinner while it downloads.. (If anyone has a link to robocopy without needing to download the entire resource kit let me know).

After installing the executables are located in ?:\Program Files\Windows Resource Kits\Tools by default. The resource kit installs a lot of extra files that you wont be using. The files that we will be working with will be robocopy.doc and robocopy.exe. Robocopy is a command line utility that can either be run from a command prompt or from a batch file.

At this point you should open the robocopy.doc and get familiar with the concepts. The best way to start is by creating a .txt file. Copy and paste the following lines of test between Start and Stop. Do not include Start and Stop in the copy and pasted sections.

Start

@Echo off
robocopy "C:\Pictures Working Directory" "D:\PhotoBackup" /E /ETA /Z /PURGE

Goto Defrag
:Defrag
defrag c:
defrag d:

Goto Done
:Done
Echo Done
Pause


Stop

I keep my working photo directory on my C: drive and backup my data to my external usb 2.0 160gb drive which is labeled D: in my computer. You can modify the directory's as you wish. Just keep in mind that the first is the source directory and the second is the destination directory.

Now lets look at the switches used. (Switches are the /something that you see at the end of the command in the batch file) Switches are used to modify how robocopy is executed and what it does. For example if we did not use any switches at all the files would copy. But I used several switches to get the additional functionality. The /E switch copies all sub-folders including empty ones. The /ETA switch turns on the progress indicator for each file being copied. The /Z switch copies each file in restartable mode. (Very useful if transferring over a network) And finally /PURGE which removes files and folders if they are not present in the source. (Caution needs to be used with this option. If you delete a folder in the source it WILL DELETE the folder in the destination)

Notice I threw in the defrag command. I use this for all of my hard drive that I have in my system. By doing this I am able to ensure they are operation at 100% efficiency.

The last step would be to rename the .txt file to .bat This will cause the file to be executable by windows. Execute the file and see if it works.

The first time it is run it may take a while depending on hardware. Subsequent backups will be faster because robocopy on copies changed files. so unless you change most of you files your backups will run in minutes. If the file worked as expected continue on to automation.

Automation

Now to automate the task. I used Windows task scheduler. It is accessed in Windows XP by clicking start - all programs - accessories - system tools - scheduled tasks.

Double Click "add a scheduled task" At this point the Scheduled Task wizard pops up. Click next. Click Browse and find the .bat file you just created. Click Open. Click the radio button next to the frequency that you would like the backup run. (I run the program nightly at 2:00 am)
Select a time for the backups to run and click Next.
Type in the username and password that will be used when the backup runs. (Make sure it is a Username with permissions to the files)
Click Finish.

There you have it, my first guide. If I have missed anything or if you have any selections please let me know and I will update this guide. I can also post screenshots if anyone is interested or has a problem.

P.S. I appologize for any mistakes. I could not sleep so instead of doing some PP work I decided to write this. It is currently 5:00am and I am now very tired.


Canon 7D
Canon EF 100-400L - Sigma EF 24-70 2.8 EX DG Macro Canon EF 50mm 1.8 - 580 EX

"Its all fun and games till the rent check bounces." Lost

  
  LOG IN TO REPLY
lost
THREAD ­ STARTER
Goldmember
Avatar
1,009 posts
Joined Jan 2005
Location: Houma, LA
     
Apr 04, 2006 15:34 |  #2

I totally forgot I even did this. Looks like everyone else did to. That bad?


Canon 7D
Canon EF 100-400L - Sigma EF 24-70 2.8 EX DG Macro Canon EF 50mm 1.8 - 580 EX

"Its all fun and games till the rent check bounces." Lost

  
  LOG IN TO REPLY
goatee
"nice but dim"
Avatar
5,239 posts
Joined May 2005
Location: North of London, UK
     
Apr 04, 2006 15:46 |  #3

Not at all - I only just spotted it - personally, I use SyncBack from www.2brightsparks.com (external link) - you can schedule it, and it's easy to configure. But, your script seems to do the job for you.


D7100, 50mm f/1.8, 18-140mm f/3.5-5.6, 70-300mm f/3.5-5.6 VR, SB800
https://photography-on-the.net/forum/showthre​ad.php?t=552906flickr (external link)

  
  LOG IN TO REPLY
lakiluno
slightly jealous
Avatar
2,895 posts
Likes: 2
Joined Oct 2005
Location: Leeds, UK (formerly Edinburgh, Scotland)
     
Apr 04, 2006 16:54 |  #4

Very useful - I'm just installing it now!!!

Leo

Edit: Set everything up, except I'm backing up from my removable disk to my main disk (small main HD, so I have a 200gig USB HD as a data-storage disk (not for games/apps etc)


Leo
20D|Tamron 17-50 2.8|Sigma 70-300mm APO DG Macro|50 1.8|Sigma EF-500 DG Super|
My Photo Gallery (external link) *New* | My Gear List | Backup Photos Easily with Robocopy

  
  LOG IN TO REPLY
BrianEE93
Senior Member
Avatar
550 posts
Joined Apr 2005
Location: St. Louis
     
Apr 04, 2006 17:59 |  #5

I just use the XP Power Toy SyncToy. You have to remember to start it but once you have it set up you just start the program and tell it to run all backups. A scheduler would be nice but what do you expect for free! Maybe Vista will have a backup scheduler.


EOS 20D w/ BG-E2
Canon EF-24mm f/2.8
Canon EF-50mm f/1.8 II
Canon EF-85mm f/1.8 USM
Sigma 24-70 EX DG Macro
Sigma 50-500 EX DG HSM w/1.4x EX
Sigma EF-500 DG Super w/BB
Manfrotto Mono(681B) & Tripod(3021PRO) w/Gimbal
Image Tank G2 OTG 40GB

  
  LOG IN TO REPLY
lost
THREAD ­ STARTER
Goldmember
Avatar
1,009 posts
Joined Jan 2005
Location: Houma, LA
     
Apr 06, 2006 23:52 as a reply to  @ lakiluno's post |  #6

lakiluno wrote:
Very useful - I'm just installing it now!!!

Leo

Edit: Set everything up, except I'm backing up from my removable disk to my main disk (small main HD, so I have a 200gig USB HD as a data-storage disk (not for games/apps etc)

Did you have any problems following the guide? Any areas that I could improve?


Canon 7D
Canon EF 100-400L - Sigma EF 24-70 2.8 EX DG Macro Canon EF 50mm 1.8 - 580 EX

"Its all fun and games till the rent check bounces." Lost

  
  LOG IN TO REPLY
lost
THREAD ­ STARTER
Goldmember
Avatar
1,009 posts
Joined Jan 2005
Location: Houma, LA
     
Apr 07, 2006 00:01 as a reply to  @ BrianEE93's post |  #7

BrianEE93 wrote:
I just use the XP Power Toy SyncToy. You have to remember to start it but once you have it set up you just start the program and tell it to run all backups. A scheduler would be nice but what do you expect for free! Maybe Vista will have a backup scheduler.

Today is your lucky day. Taken directly from the SyncToy 1.2 help file.

You may need to be running version 1.2 for this to work.

Schedule SyncToy


While you do not have to schedule SyncToy to use it, some users may find it helpful to schedule recurrent SyncToy runs. Perhaps you have a folder pair that takes a long time to sync and you want to run SyncToy in the middle of the night, for example. SyncToy does not provide a user interface to schedule folder pairs to run at designated times. However, there is a method to schedule tasks using the Microsoft© Windows© operating system.
To schedule a task using the operating system:


  1. From the </B>Start</B> menu, select All Programs - Accessories - System Tools - Scheduled Tasks.
  2. Select Add scheduled task to start the Scheduled Task Wizard. You will see a list of possible programs to run.
  3. SyncToy may appear as an option in the list. If SyncToy does not appear in the list, click Browse and go find it.
  4. The wizard will next prompt you to enter how often you want to run the scheduled SyncToy (for example, daily, weekly, et cetera). Select a frequency.
  5. The next page asks when to start the task. Select a start time.
  6. The next page asks for the user name and password to run the program under. Enter your user name and password.
  7. The final page contains an option to open the properties dialog when the wizard ends. Select this checkbox.
  8. Modify the Run textbox to include the –R command line option. –R all by itself will run all folder pairs that are active for run all. If you want to run just a single folder pair, add –R“My Pair” to the end of the command line. Note: there is a space before the hyphen but not one after the R. If the folder pair name contains a space, surround it with quotation marks, as the example above shows. For another example, assume that SyncToy is in the folder named C:\My Folder and that you want to run a folder pair named "My folder pair." Enter the command line as follows, including the quotation marks: "C:\My Folder\SyncToy.exe" -R"My folder pair." Note that there are two sets of quotation marks in this case: one is around the path to the SyncToy program file and the other surrounds the folder pair name.

Canon 7D
Canon EF 100-400L - Sigma EF 24-70 2.8 EX DG Macro Canon EF 50mm 1.8 - 580 EX

"Its all fun and games till the rent check bounces." Lost

  
  LOG IN TO REPLY
tim
Light Bringer
Avatar
51,010 posts
Likes: 375
Joined Nov 2004
Location: Wellington, New Zealand
     
Apr 07, 2006 00:59 as a reply to  @ lost's post |  #8

lost wrote:
I totally forgot I even did this. Looks like everyone else did to. That bad?

Drunk posting strikes again, in a far more useful way than usual ;) :D


Professional wedding photographer, solution architect and general technical guy with multiple Amazon Web Services certifications.
Read all my FAQs (wedding, printing, lighting, books, etc)

  
  LOG IN TO REPLY
condyk
Africa's #1 Tour Guide
Avatar
20,887 posts
Likes: 22
Joined Mar 2005
Location: Birmingham, UK
     
Apr 07, 2006 05:10 |  #9

I sync and backup using Handy Backup but then I like an easy life. You guys seem to enjoy a lot of hard work ;-)a


https://photography-on-the.net …/showthread.php​?t=1203740

  
  LOG IN TO REPLY
tim
Light Bringer
Avatar
51,010 posts
Likes: 375
Joined Nov 2004
Location: Wellington, New Zealand
     
Apr 07, 2006 05:54 |  #10

roboycopy c: d:

That simple *

* almost


Professional wedding photographer, solution architect and general technical guy with multiple Amazon Web Services certifications.
Read all my FAQs (wedding, printing, lighting, books, etc)

  
  LOG IN TO REPLY
condyk
Africa's #1 Tour Guide
Avatar
20,887 posts
Likes: 22
Joined Mar 2005
Location: Birmingham, UK
     
Apr 07, 2006 05:56 as a reply to  @ tim's post |  #11

tim wrote:
roboycopy c: d:

That simple *

* almost

Nah, Tim son you're already into fault finding and you only typed 4 digits :roll:


https://photography-on-the.net …/showthread.php​?t=1203740

  
  LOG IN TO REPLY
tim
Light Bringer
Avatar
51,010 posts
Likes: 375
Joined Nov 2004
Location: Wellington, New Zealand
     
Apr 07, 2006 06:10 as a reply to  @ condyk's post |  #12

condyk wrote:
Nah, Tim son you're already into fault finding and you only typed 4 digits :roll:

Hey, you found my intentional error ;) My friend Mr Beam isn't helping... :p


Professional wedding photographer, solution architect and general technical guy with multiple Amazon Web Services certifications.
Read all my FAQs (wedding, printing, lighting, books, etc)

  
  LOG IN TO REPLY
lost
THREAD ­ STARTER
Goldmember
Avatar
1,009 posts
Joined Jan 2005
Location: Houma, LA
     
Apr 07, 2006 14:46 as a reply to  @ condyk's post |  #13

condyk wrote:
I sync and backup using Handy Backup but then I like an easy life. You guys seem to enjoy a lot of hard work ;-)a

But can you automatically defrag your disks at the same time?

The fewer programs I have installed on my computer the better. And this tool has never failed, not one time in 2 years. It also can copy over my home network if need be. (handy for syncing photos with my laptop after a trip)

GUIs suck. :)


Canon 7D
Canon EF 100-400L - Sigma EF 24-70 2.8 EX DG Macro Canon EF 50mm 1.8 - 580 EX

"Its all fun and games till the rent check bounces." Lost

  
  LOG IN TO REPLY
resmartin
Hatchling
1 post
Joined Sep 2013
     
Sep 28, 2013 03:00 |  #14

Use Long Path Tool for this.




  
  LOG IN TO REPLY
sponsored links (only for non-logged)

14,024 views & 0 likes for this thread, 7 members have posted to it.
How to automate backups using Robocopy
FORUMS Post Processing, Marketing & Presenting Photos RAW, Post Processing & Printing 
AAA
x 1600
y 1600

Jump to forum...   •  Rules   •  Forums   •  New posts   •  RTAT   •  'Best of'   •  Gallery   •  Gear   •  Reviews   •  Member list   •  Polls   •  Image rules   •  Search   •  Password reset   •  Home

Not a member yet?
Register to forums
Registered members may log in to forums and access all the features: full search, image upload, follow forums, own gear list and ratings, likes, more forums, private messaging, thread follow, notifications, own gallery, all settings, view hosted photos, own reviews, see more and do more... and all is free. Don't be a stranger - register now and start posting!


COOKIES DISCLAIMER: This website uses cookies to improve your user experience. By using this site, you agree to our use of cookies and to our privacy policy.
Privacy policy and cookie usage info.


POWERED BY AMASS forum software 2.58forum software
version 2.58 /
code and design
by Pekka Saarinen ©
for photography-on-the.net

Latest registered member was a spammer, and banned as such!
2655 guests, 108 members online
Simultaneous users record so far is 15,144, that happened on Nov 22, 2018

Photography-on-the.net Digital Photography Forums is the website for photographers and all who love great photos, camera and post processing techniques, gear talk, discussion and sharing. Professionals, hobbyists, newbies and those who don't even own a camera -- all are welcome regardless of skill, favourite brand, gear, gender or age. Registering and usage is free.