Share via


Working with File Management Tasks

Applies To: Windows Server 2008 R2

File management tasks automate the process of finding subsets of files on a server and applying simple commands to them on a scheduled basis. File management tasks include a file expiration command, and you can also create custom tasks. You can define files that will be processed by a file management task through the following properties:

  • Location

  • Classification properties

  • Creation time

  • Modification time

  • Last accessed time

  • Filename

You can also configure file management tasks to notify file owners of any impending policy that will be applied to their files.

Note

Individual file management tasks are run on independent schedules.

In this section:

  • Creating a file expiration task

  • Creating a custom file management task

Note

To set e-mail notifications and certain reporting capabilities, you must first configure the general File Server Resource Manager options for e-mail.

Creating a file expiration task

File expiration tasks are used to automatically move all files that match certain criteria to a specified expiration directory, where an administrator can back up those files and delete them.

When a file expiration task is run, a new directory is created within the expiration directory. The new directory is grouped by the server name on which the task was run, and it is named according to the name of the file management task and the time it was run. When an expired file is found it is moved into the new directory, while preserving its original directory structure.

The following procedure guides you through the process of creating a file management task for expiring files.

To create a file expiration task

  1. Click the File Management Tasks node.

  2. Right-click File Management Tasks, and then click Create File Management Task (or click Create File Management Task in the Actions pane). This opens the Create File Management Task dialog box.

  3. On the General tab, enter the following information:

    • Name. Enter a name for the new task.

    • Description. Enter an optional descriptive label for this task.

    • Scope. Add the directories that this task should operate on by using the Add button. Optionally, directories can be removed from the list by using the Remove button. The file management task applies to all folders and their subfolders in this list.

  4. On the Action tab, enter the following information:

    • Type. Select File Expiration from the drop-down list.

    • Expiration Directory. Select a directory where you want the expired files to be moved.

Warning

Do not select a directory that is within the scope of the task, as defined in the previous step. Doing so could cause an iterative loop that could lead to system instability and data loss.

  1. Optionally, on the Notification tab, click Add to send e-mail notifications, log an event, or run a command or script a specified minimum number of days before the task performs an action on a file.

    • In the Number of days before task is executed to send notification combo box, type or select a value to specify the minimum number of days prior to a file being expired that a notification will be sent.

Note

Notifications are sent only when a task is run. If the specified minimum number of days to send a notification does not coincide with a scheduled task, the notification will be sent on the day of the next previously scheduled task.

  - To configure e-mail notifications, click the **E-mail Message** tab and enter the following information:  
      
      - To notify administrators when a threshold is reached, select the **Send e-mail to the following administrators** check box, and then enter the names of the administrative accounts that will receive the notifications. Use the format *account@domain*, and use semicolons to separate multiple accounts.  
          
      - To send e-mail to the person whose files are about to expire, select the **Send e-mail to the user whose files are about to expire** check box.  
          
      - To configure the message, edit the default subject line and message body that are provided. The text that is in brackets inserts variable information about the quota event that caused the notification. For example, the **\[Source File Owner\]** variable inserts the name of the user whose file is about to expire. To insert additional variables in the text, click **Insert Variable**.  
          
      - To attach a list of the files that are about to expire, click **Attach to the e-mail list of files on which action will be performed**, and then type or select a value for the **Maximum number of files in the list** combo box.  
          
      - To configure additional e-mail headers (including From, Cc, Bcc, and Reply-to), click **Additional E-mail Headers**.  
          

<!-- end list -->

  - To log an event, click the **Event Log** tab, select the **Send warning to event log** check box, and then edit the default log entry.  
      
  - To run a command or script, click the **Command** tab, and then select the **Run this command or script check** check box. Type the command or click **Browse** to search for the location where the script is stored. You can also enter command arguments, select a working directory for the command or script, or modify the command security setting.  
      
  1. Optionally, use the Report tab to generate one or more logs or storage reports.

    • To generate logs, select the Generate log check box, and then select one or more available logs.

    • To generate reports, select the Generate a report check box, and then select one or more available report formats.

    • To e-mail generated logs or storage reports, select the Send reports to the following administrators check box, and then type one or more administrative e-mail recipients using the format account@domain. Use a semicolon to separate multiple addresses.

Note

The report is saved in the default location for incident reports, which you can modify in the File Server Resource Manager Options dialog box.

  1. Optionally, use the Condition tab to run this task only on files that match a defined set of conditions. The following settings are available:

    • Days since file was last modified. Click the check box, and then enter a number of days into the spin box. This results in the file management task being applied only to files that have not been modified for more than the specified number of days.

    • Days since file was last accessed. Click the check box, and then enter a number of days into the spin box. If the server is configured to track time stamps for when files were last accessed, this results in the file management task being applied only to files that have not been accessed for more than the specified number of days. If the server is not configured to track accessed times, this condition is ineffective.

    • Days since file was created. Click the check box, and then enter a number of days into the spin box. This will result in the task being applied only to files that were created at least the specified number of days ago.

    • Wildcard pattern matching file name. Click the check box, and then enter a wildcard pattern in the text box. This results in the task being applied only to files with names that match the wildcard pattern.

    • Effective starting. Set a date when this file management task should start processing files. This option is useful for delaying the task until you have had time to notify users or make other preparations.

    • Property conditions. Click Add to create a new condition based on the file’s classification (for information about file classification, see Working with File Classification). This opens the Property Condition dialog box, which allows you to select a classification property, an operator to perform on the property, and the value to compare the property against. Click OK, then optionally, you can create additional conditions, or edit or remove an existing condition.

  2. On the Schedule tab, click Create Schedule, and then in the Schedule dialog box, click New. This displays a default schedule set for 9:00 A.M. daily, but you can modify the default schedule. When you have finished configuring the schedule, click OK.

  3. Click OK.

Creating a custom file management task

Expiration is not always a desired action to be performed on files. File management tasks also allow you to run custom commands.

This procedure assumes that you are familiar with file management tasks, and only covers the Action tab where custom settings are configured.

To create a custom task

  1. Click the File Management Tasks node.

  2. Right-click File Management Tasks, and then click Create File Management Task (or click Create File Management Task in the Actions pane). This opens the Create File Management Task dialog box.

  3. On the Action tab, enter the following information:

    • Type. Select Custom from the drop-down list.

    • Executable. Type or browse to a command to run when the file management task processes files.

Note

The executable must be set to be writable by Administrators and System only. If any other users have Write access to the executable, it will not run correctly. In addition, the directory that contains the executable and any parent directories must only allow Write access to Administrators or System.

  - **Command settings**.  
      
      - **Arguments**. Edit this text box to configure the arguments that are passed to the executable when a file management job processes files.  
          
      - **Variables**. To insert additional variables in the text, place the cursor in the text box where you want to insert the variable, select the variable from the drop-down list, and then click **Insert Variable**.  
          
        The text that is in brackets inserts the variable information that the executable can receive. For example, the \[Source File Path\] variable inserts the name of the file that should be processed by the executable.  
          
      - **Working directory**. Optionally, click this button to specify the location of the custom executable.  
          
  - **Command Security**. Configure the security settings for this executable. By default, the command is run as Local Service, which is the most restrictive account available.  
      
  1. Click OK.