can some write me a simple batch file/ robocopy config?

chronic9

Supreme [H]ardness
Joined
Aug 18, 2004
Messages
5,854
can someone write me a simple batch file to back up my data. i will either schedual it to run through windows or click the button on my onetouch.

i need to back up C: , M: , x: , d: , incremental back up.

and if possible, can it make a log file and output it to the desktop?

i know there is robocopy but that is even harder for me to figure out.
but if ur willing to write it in robocopy, plz do :p

thnx for your help.
 
what is the drive letter you want to back it up to? Do you want to maintain a mirror of your actual data? Robocopy is fairly easy to get working once you get used to it. If you type robocopy /??? you will get a list of the top 30 or so commands.

However, off the top of my head it would look something like this based of the following assumptions
**you are backing up to an external HD named Z:\
**on that extra HD you are going to create a series of folders that correspond to the way your data is stored (i.e. if you are backing up D:\ you might make a folder called "D_Drive" on your external drive)
**you want to maintain a mirror of your current data

robocopy D:\ Z:\D_Drive /MIR /R:3 /W:3 /V /log:"C:\Documents and Settings\username\desktop\d_drive_backup.log"

just copy that line a few times into notepad, each time replacing the drive letter, destination, and log file name. Then rename the finished txt as a .bat and you have yourself an executable you can either double click or schedule.

Just a few things to keep in mind:
**a "/" is always the key to another comman or attribute
**the /R:3 and /W:3 are telling robocopy to "retry" 3 times "waiting" 3 seconds each time if it runs into a file it can't copy
**/MIR can be dangerous if you are running it as a back up situation - meaning if you corrupt or delete a file, then run the script, the file is corrupted or deleted from your archive as well. You can use a /E in it's place but your archive drive can get messy after a while
**RTFM - the help is just the beginning of robocopy. There is a manual available for robocopy that has hundreds more switches in it. Take the time to browse through it.
 
ill move the files to drive O and iwant to keep all of the files on my drive, just have a cloned copy of my HDD on the external. thats all.

thanks for the explanation.


c-boogie said:
what is the drive letter you want to back it up to? Do you want to maintain a mirror of your actual data? Robocopy is fairly easy to get working once you get used to it. If you type robocopy /??? you will get a list of the top 30 or so commands.

However, off the top of my head it would look something like this based of the following assumptions
**you are backing up to an external HD named Z:\
**on that extra HD you are going to create a series of folders that correspond to the way your data is stored (i.e. if you are backing up D:\ you might make a folder called "D_Drive" on your external drive)
**you want to maintain a mirror of your current data

robocopy D:\ Z:\D_Drive /MIR /R:3 /W:3 /V /log:"C:\Documents and Settings\username\desktop\d_drive_backup.log"

just copy that line a few times into notepad, each time replacing the drive letter, destination, and log file name. Then rename the finished txt as a .bat and you have yourself an executable you can either double click or schedule.

Just a few things to keep in mind:
**a "/" is always the key to another comman or attribute
**the /R:3 and /W:3 are telling robocopy to "retry" 3 times "waiting" 3 seconds each time if it runs into a file it can't copy
**/MIR can be dangerous if you are running it as a back up situation - meaning if you corrupt or delete a file, then run the script, the file is corrupted or deleted from your archive as well. You can use a /E in it's place but your archive drive can get messy after a while
**RTFM - the help is just the beginning of robocopy. There is a manual available for robocopy that has hundreds more switches in it. Take the time to browse through it.
 
that program is cool. except, after i made the script and saved it as a batch file. i try to run it and nothinh happens. just the CMD window appears for 2 secs and vanishes, checked the destination directory and nothing is there either.
 
chronic9 said:
that program is cool. except, after i made the script and saved it as a batch file. i try to run it and nothinh happens. just the CMD window appears for 2 secs and vanishes, checked the destination directory and nothing is there either.


Can't really help you here.....
I'm just getting started with it too.
sorry

 
Back
Top