Archiving Files Once A Week Example

In this example, we will create a task that makes a backup of your Microsoft  Word documents and other text documents by zipping the documents together into one file and placing it onto floppy disk every Friday night at 11PM.

WHAT'S COVERED:
* Step by step creation of a managed task using the Add Task Wizard
* Introduction to triggers, with emphasis on the Schedule Watcher
* Introduction to building a task steps with the Task Builder
* Using the Zip Files and Move Files actions to compress and move files

* Using wildcards to include more than one file in a step

NOTE: This example assumes that the Add Task Wizard is used to create tasks.  This is the default behaviour.  To ensure the Add Task Wizard is used, go to the System | Options menu in the AutoMate Task Administrator, and from the General tab, make sure "Use Add Task Wizard when adding tasks" is selected.

Step 1:
Click the New button from the toolbar of the AutoMate Task Administrator.

Step 2:
The Add Task Wizard should appear.  Click the Next button to move to the next page.

Step 3:
Enter a name for your task.  For example, "Weekly Document Archive". This is the name by which the task will be referred to ask in the Task Administrator.   Click the Next button.

Step 4:
Here we can apply one or more triggers to the task.  A trigger is an event or condition that occurs on your system that will cause the task to start.  For our example, we want a particular time once a week to trigger our task.  Therefore, we need to add a "Schedule Watcher".  Click the Add button to display a list of available triggers.

Step 5:
From
the list of available triggers, click Schedule Watcher, then click OK.

Step 6:
You are now looking at the Schedule Watcher properties.  From here you can configure a schedule for the task to trigger upon.  For our example, we want to trigger every Friday night at 11PM.  To do this, change Interval to "Specific days of the week".  This will allow us to choose what days of the week we want the task to run.  Ensure "Every" is set to 1 week.  This will make the schedule repeat every week.  Select the "Friday" option.  You could select more than one day of week if you wish, but since we only want a backup once a week, Friday is sufficient.  Next, enter the date of the day you wish the task to run for the first time.  For our example, we'll set it to November 29, 2002, which is the first Friday of that week, at 11:00 PM.  (Note that by clicking the down-arrow button of the date field, a small calender appears to aid in choosing a date).

Step 7:
Next, we should make sure that the task is going to reschedule the way we'd like it to.  Normally, once AutoMate triggers a task based on the Schedule Watcher, the task will automatically schedule itself to start again based on the options you've selected.  You can modify exactly how AutoMate does this rescheduling by selecting the Rescheduling tab on the Schedule Watcher.  For our example, make sure Immediately Run The Task" and "Relative to the originally set time" are selected.  This will cause the task to immediately run the task if it is late when AutoMate starts, and reschedule the task from the original time it was meant to trigger.  Once you're finished, click OK.

Step 8:
Now, the Triggers part of the Add Task Wizard should contain your one Schedule Watcher trigger. Click the Next button to move to the next page of the wizard.

Step 9:
Now, we need to build the steps of the task.  This is where you specify exactly what the task is to do when it is started.  This is done using the AutoMate Task Builder, which is an editor made specifically for creating and debugging AutoMate Tasks.  Click the "Create Steps" button to start the AutoMate Task Builder.

Step 10:
The Task Builder provides many functions to help you in creating and debugging your task.  For this example, we will use only a very small part of its capabilities.  The left side of the Task Builder contains the "Available Actions".  Within this window are all the actions that AutoMate can do.  The right hand side contains all the steps that the task will execute when the task runs.  Steps are executed one after the other in the order they appear on the right side.  Our task is going to consist of only two steps: Zip Files and Move Files.  Our first step will be to create a zip file that contains the documents to be archived.  Find the "Zip Files" action under Available Actions by expanding the Compression group (either by clicking the + to the left of the word "Compression" or by double-clicking on "Compression").  Double-click "Zip Files", or drag it to the right hand side by holding the left-mouse button over the action name, sliding the mouse over the steps section of the Task Builder, and releasing the mouse button.

Step 11:
Most actions have properties you can set to further configure exactly what the step is to do.  In our case, we need to tell the Zip Files action to zip only files in our My Documents directory that end with .doc and .txt (the two extensions that Microsoft Word and standard text files have respectively).  We also need to tell it what the name of the zip file is and where AutoMate should put it.  First, we'll select the files we need to zip.  Click the open folder button to the right of the "Files to zip:" area.  Browse to your My Documents folder and select a document.  Click OK.  The full path to that document will appear in the "Files to zip" field.
Normally this would be sufficient if all we needed to do was backup only one file.  However, we want to backup
all documents and text files.  To do this, we need to use a wildcard.  A wildcard character will cause AutoMate to use any file that matches our mask, replacing an asterisk with any characters required to make the file match. In our case, we need to match any file that ends with .doc or a .txt, but is still in our My Documents folder.  Start by highlighting all the text that appears after the path to My Documents.

Step 12:
Replace the highlighted text with *.doc, and vertical bar, and then *.txt.  Remember that an asterisk means to use any file as long as it ends matches the rest of the text, in this case .doc or .txt.  The vertical bar is used to separate multiple masks.

Step 13:
Next we need to specify where to place the zip file, and what to do name it.  We'll call it archive.zip, and place it in our My Documents folder.  Click to open folder button to the right of the "Zip file" field, and browse to My Documents.  In the "File name" field, type in "archive.zip".  And click OK.  Your Zip Files Action window should now look like this:

Step 14:
We'll need to duplicate the name of the zip file for our next step.  So before clicking the OK button, right-click on the "Zip file" field, and select "Select All".  Right-click on the field again and select "Copy".  This will place the full path to the zip file on the clipboard so we can use it in the next step.  Click OK.

Step 15:
Our complete Zip Files step should now be in the Task Builder.  When the task runs, AutoMate will zip all our documents into a zip file named archives.zip.  Now we need to move it from our My Documents folder and onto the floppy drive.  From the Available Actions, find the Move File action in the FIle group.  Double-click or drag to add it to your task.

Step 16:
Here we need to specify what file should be moved, and where to.  Since the file we want to move doesn't exist yet (it won't exist until we run the task), attempting to browse to the file isn't going to help us.  Luckily we copied the text from the previous step.  Right-click over the "Source:" field and select Paste.  The path should automatically be entered into the field for you.  Next, specify the destination by clicking the open folder button to the right of "Destination".  Browse to the floppy drive (be sure there is a disk in there!).  In the "File name" field, enter "archive.zip".  Click OK.

Step 17:
Thats it!  Those two simple steps will create a zip file backup of all the Microsoft Word and standard text files from your My Documents folder, and then copy the zip file to a floppy drive.  This part of the task is now complete.  Click the "Update And Save" button from the toolbar to save your changes and close the Task Builder.  You will be returned to the Add Task Wizard.

Step 18:
Now that we are finished adding the task steps, click the Next button.  The next page is used on Windows 2000/NT/XP to specify whether or not the task should run when a workstation is logged off or locked.  For this example, leave the defaults: the task will not run when the workstation is logged off, but will run invisibly when the workstation is locked.  Click the Next button.

Step 19:
The final page of the Add Task Wizard provides a summary of the task you built.  Click the Finish button.  The completed Managed Task now appears in your Task Administrator.  Every Friday at 11PM, the task will execute, zipping up files and placing the finished product onto your floppy disk.  Just be sure to have a floppy disk in your drive before you leave on Friday!

See Also:

Introduction to triggers

Introduction to actions

Introduction to the Task Builder

Introduction to the Task Administrator

Schedule Watcher Trigger

Zip Files Action

Move Files Action