Copyright MonkeyJob Systems 2005
All rights reserved

Home FAQ Forums Contact
Download Tutorials FAQ Awards Report Bugs
 Search For Data

Backing Up Files

The following tutorial will teach you how to back up your files using the command line backup script.

Every file on your computer has an archive attribute (flag). This flag can take 2 values, TRUE or FALSE.

A TRUE value means that the file has changed since it was created. A FALSE value means that the file has not changed since it's creation.

You can view the attributes of any file on your computer by right-clicking on the file and selecting "properties". This will open the properties window for that file. At the bottom of this window, you will see displayed the attributes for that file including the archive attribute.

The command line backup script checks the archive attribute of each target file

If the archive attribute is FALSE then the script will take no action on that file and move on to the next target file.

If the archive attribute is TRUE then the script will copy that file to a specified location (a backup folder) and then reset the archive attribute of the target file to FALSE.

Your computer will set the archive attribute of a file to TRUE in the following situations:

The file was just changed
The file was just created
The file was just renamed
* The file was just copied to it's current location

* When you first use the backup script, it may backup more files than you would expect. This is because there may be files on the target path that have been copied there. When a file is copied, the archive attribute of the copied file is set to TRUE.

For example, all target files could have an archive flag of TRUE. This means that your computer thinks that all of these files need backing up.

To check which target files have a TRUE archive flag, you could use the FileMonkey "List" feature (Set it to search archive targets).

You could use the "Attributes" feature of FileMonkey to change all archive flags to FALSE but then the backup script will not find any files to backup until you make changes to these files.

Here are step by step instructions on using the backup script:


Target your files. Click HERE for a targeting tutorial.


Once you have targeted your files, select the "Quick-Find / Command Line" menu item from the main window.


The Create/Run batch file window should now be open (Fig 1)

Fig 1

make batch jobs


Now you must load the backup script into the command line window.

From the menu bar at the top of the command line window, select the "File / Load Code" menu item.

Fig 2

open backup script


This will open the load file dialogue box (Fig 2).

Use this box to navigate to the folder that FileMonkey is installed in (This is usually something like: C:\Program Files\FileMonk)

Select the file BackUp Files.FM and click the "Load" button.


Next you will need to enter the location that you wish to backup your files to.

In the head section of the script, find the following line:

set DestDir="C:\_Backup"

Fig 3

change backup folder


Now you must enter the location (folder) that you wish to backup your files to. We have entered the folder "C:\_Backup" as the default value (See: Fig 3). If you wish to use another folder then enter the name in this section.

For example: if you want the use the folder "C:\My Documents" then change the line:

set DestDir="C:\_Backup"


set DestDir="C:\My Documents"


The backup job is designed to work on files with a TRUE archive flag. Make sure that the "Work On Archive Files" option is selected (near bottom right of window)


If you wish to extend the job to work on sub-folders then set the folder options in the bottom section of the command line window. By default, we have set this to work on all sub-folders for this job.


To start the operation, select the "File / Compile And Run" menu item.


All files that your computer thinks need backing up should now have been moved to the backup folder that you specified. If any errors occurred, they should be displayed in the error log file. If no errors occurred then the batch job will not attempt to create or open an error log file. Close the command line window.

If more files were copied than you expected, this is probably due to the situation described in the first section of this tutorial (before step 1). The next time you run this job, this problem should not occur as the archive attributes of all target files have been reset to FALSE by the above script.

Related Topics:
FileMonkey Tutorials
Frequently Asked Questions
Using the command line append script to change file extensions
Using the command line feature to delete empty folders
Using the command line feature to move or copy files
Using the command line feature to unzip many files

  | About Us | Privacy Policy | Terms Of Use | Affiliates | Forums | Copyright 2003 MonkeyJob Systems All Rights Reserved |