This topic describes how to run a script that moves or deletes
files based on file attributes, such as storage pool, fileset, file age, and
size. These attributes are defined as a set of file management rules.
Prerequisites
You must have Administrator privileges to perform this task.
The client must have access to all LUNs in the source and
target storage pool for the files that are being moved.
Context
The script, called sfslcm, is run on the
master metadata server. You can run the script automatically at regularly
scheduled intervals using a UNIX® cron job and control its priority
with the UNIX nice
command.
You can run the script in planning mode first to check the
projected results, before running it directly. When you run the script directly,
be aware that files that are open can still be moved or deleted.
Note: - When moving files, all the FlashCopy® images for the file are
also moved.
- When deleting files, only the primary image of the file is deleted; FlashCopy images
are not deleted.
Steps
- If you are running the script in planning mode first and then direct
mode, follow these steps:
- Using a text editor, create a rules file specifying your policy
for moving and deleting files. See File management policy syntax for
details.
- Run the sfslcm script in planning mode
by entering ./sfslcm.pl -phase plan -rules rules_file_name -plan plan_file_name,
where
- rules_file_name
- The fully qualified or relative path name of the
rules file.
- plan_file_name
- The fully qualified or relative path name of the
file to which the plan is written.
- Examine the resulting plan. The plan file contains a line of
information for each file that would be affected by running the script. Each
line includes the operation type (migrate or delete); the source storage pool
name and, if applicable; the target storage pool name; the fileset name; the
file creation time, change time, access time, modify time, and size; and the
absolute file path name. The format of the time fields is YYYYMMDDHHMMSS.
You can rerun the sfslcm script in planning mode until
you receive the results you want. You can also edit the plan and input it
to the sfslcm script when you run the script directly.
- Run the sfslcm script directly by entering ./sfslcm.pl
-phase execute -rules rules_file_name -plan plan_file_name -verbose
-log log_directory_name -client client_name, where
- rules_file_name
- The fully qualified or relative path name of the
rules file.
- plan_file_name
- The fully qualified or relative path name of the
plan file that was written when the script was run in planning mode.
- log_directory_name
- The name of the directory in which the log file is produced.
- client_name
- One or more names of clients to perform the move and delete operations.
Note: When performing move and delete operations for multiple clients,
you must specify each client as follows: -client client_name1 -client client_name2
- If you are running the script in direct mode follow these steps:
- Using a text editor, create a file specifying your policy for
moving and deleting files. See File management policy syntax for
details.
- Run the sfslcm script directly by entering ./sfslcm.pl
-phase execute -rules rules_file_name -verbose -log log_directory_name -client client_name,
where
- rules_file_name
- The fully qualified or relative path name of the
rules file.
- log_directory_name
- The name of the directory in which the log file is produced.
- client_name
- One or more names of clients to perform the moves and delete operations.
Note: When performing move and delete operations for multiple clients,
you must specify each client as follows: -client client_name1 -client client_name2
- A return code of 0 from the sfslcm script
indicates that all actions were performed successfully. With a non-zero return
code, you should check the log file to see if the actions ran as expected.