Copyright Michael Karbo, Denmark, Europe.


  • Next chapter.
  • Previous chapter.


    Chapter 20. Backup copies

    Data can be very important, and therefore you should make backup copies. That is done by copying large numbers of files and folders – typically from the harddisk – to another storage media.

    Backup can be done in many ways. I show two of them in this chapter.

    The Backup program

    Try this small exercise, which shows how the Windows XP Backup tool works:

    1.      In the program group System Tools you need to open the Backup tool:

    2.      Now you can choose a guide, which can help you through the backup copying. I recommend that you skip the guide, since it makes things more compilcated than you need. Quit the guide by clicking the text link ”Advanced”.

    3.      That opens the Backup program, which has a dialog box with four tabs. Click on the Backup tab:

     

    4.      Now you need to select those files that you want to backup. You do that in the left window. Try to select the folder My Documents by placing a checkmark in the small field by it:

    5.      In the bottom of the window you need to choose a location for the backup copy. I have created a folder D:\Backup, and I will use that. You can click on the Browse… button to select (or possibly create) a folder:

    6.      When you have identified the placement, you need to click on the button Start backup copying:

    7.      I the next window you can enter a name for the backup copy. Then click on the Start backup copying again. Then it runs:

    Figure 92. Backup copying is in progress.

    The Backup program saves all the selected folders and files in one file.

    The idea is that your data can be recreated from the backup copy. That is done on the tab Restore and Administrate media. There you select the backup copy to be restored. You can also select individual files to restore:

    Figure 93. Selection of files to be restored from a backup copy.

    The Backup program is primarily designed for backup copying on tape[n30] . If you have such a unit, you can select to compress your data; that is a great advantage. For we who do not have a tape drive the program has only a limited value. But there are good possibilities to plan the job, so the backup copying is done automatically at selected times. Judge for yourself if you can enjoy that.

    You also need to consider where you save your backup copies. You can backup copy your data to a folder on the same harddisk, but that does not give total safety, what if the harddisk crashes? It is better to copy to another hardisk – either in the same pc or on a network. You can also use CD-RW disk for backup.

    Backup copy from command line

    I use quite a different method for backup copying. I simply make a copy of all my documents. The copy is placed on another harddisk, and that is done daily. I use a command called xcopy. I can save the command in a small batchfile, which I can activate with a doubleclick (see bottom of page 81). That is easy and convenient!

    In this exercise we will make a copy af your documents saved in the folder My Documents. The copy is placed in a folder ”doccopy”, which is create at the same time. That works lightning fast:

    1.      Select the menu item Run in the start menu. The command will be explained later, but type it now precisely on one line as shown below. There are two spaces; one after xcopy and one after c:\My Documents\*.*. Type:

    xcopy c:\My Documents\*.* c:\doccopy\*.*/s

    2.      You can see the dialog box here, the spaces are hard to see:

    3.      Click OK. These files are copied in my computer:

    4.      The window closes by itself when the copying is done.

    5.      The folder doccopy will be created automatically. You could use Windows Explorer to look at the C drive. You can also see that the sub folders to the folder My Documents are also created:

    6.      Now look at a smart detail. Run the command once more, where you now add the parameter /m/y in the end of the line. The command thus ends with /s/m/y:

    7.      The result is that the same files are copied. But then run the same command once more. No files are copied this time. Why? Well, the parameter /m has the effect that only files that have changed since the last copying (with the /m parameter) are copied!

    8.      Try for yourself to open one of the textfiles in the folder C:\My Documents\x1. Save it again, and then run the last command once more. Then only the file you have changed is copied.

    The smart feature is thus that when you copy with the /m para­me­ter, the operating system identifies that the files are copied. And if you did not change the files, they are not included in the next copying.

    That is quite smart and can be used for daily backup copying. So in stead of backup copy all files, you only copy those that have changed. That goes much faster.

    The command explained

    You have now tried to backup copy with use of the ”xcopy” command, which can be expanded with different parameters. It may look a little complicated the first time you see it. Read the explanation below about the four steps in the command.

    Experiment for yourself, so you learn to use the xcopy command. You could look in Windows’ Help for additional information.

     

    Step

    Meaning

    xcopy

    The command itself that starts the sequence.

    c:\My Documents\*.*

    The ”source”, that is the folders to copy from. Here the request is to copy all files in the folder My Documents, which can be read from the star-period-star (meaning ”all files, regardless of their name
    and suffix”.

    c:\doccopy\*.*

    The ”Destination”, that is the folder to be copied to.

    /s

    Include all subdirectories.

    /m

    Include only files that have changed
    since the last copying.

    /y

    Exclude messages about over­writing.

    figure 94. Backup copying through command line is an excellent tool.

    A batch-file

    If you like the backup copying format that is described in figure 94, you can to your advantage save the command in a small file. Prøv:

    1.      Right click on an empty part of the desktop.

    2.      Select New à Text document. You see the new document on the screen right away.

    3.      Enter the file name bak.bat as here:

    4.      Confirm the change of the file name, and notice that the icon changes.

    5.      Now right click on the icon and select Edit. Then the file opens in Notepad. Enter the command – either this or your own version:

    6.      Then save the file, and close Notepad.

    Now can you backup copy by doubleclicking on the batch file (which it is called) bak.bat, which is on the desktop.


  • Next chapter.
  • Previous chapter.


  • Book overview.