16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

skulker<br />

Description<br />

Options<br />

skulker finds files that are candidates for deletion in directory, based on the age<br />

specified by days_old.<br />

When you call skulker without any options, the files that are candidates for deletion<br />

are found using the primaries as in the following find command line:<br />

find directory -type f -atime +days_old -level 0 -print<br />

For example, specifying 5 for days_old causes the find command to find files equal<br />

to or older than 5 24-hour intervals earlier than now.<br />

The skulker script (which is a z/<strong>OS</strong> shell script, and can be found in /samples)<br />

should be copied and can be modified to suit your particular needs. Possible<br />

locations for placing the script include /bin or /usr/sbin, especially if skulker is to<br />

be run from a UID(0) program. If skulker is to be run by users, /usr/bin is another<br />

possibility, but check that the sticky bit is on in the directory. If the script is called<br />

from a privileged user (a superuser, a user with a UID of 0, or a user running with<br />

the RACF trusted or privileged attribute), it is important to protect the script from<br />

any modifications by a non-privileged user.<br />

–i Displays the files that are candidates for deletion, and prompts the user to<br />

stop or continue with file removal. Do not use this option if you are invoking<br />

skulker from a cron job. If skulker is invoked with –i from a cron job, no<br />

files will be deleted. A message will be mailed to the caller, showing the<br />

skulker output that includes the message “Request canceled.”<br />

–l Specifies a logfile to store a list of files that have been deleted, are<br />

candidates for deletion, or for which warnings have been mailed; and any<br />

errors that may have occurred.<br />

–r Moves recursively through subdirectories, finding both files and<br />

subdirectories that are equal to or older than the specified number of days.<br />

The files that are candidates for deletion are found using the primaries as in<br />

the following find command line:<br />

find directory -atime +days_old ! -name directory -print<br />

The –name primary prevents skulker from deleting the actual directory that<br />

was entered as a start point (for example, /tmp).<br />

–w Does not remove files, but sends a warning to the owner of each old file<br />

(using mailx) that the file is a candidate for deletion.<br />

days_old<br />

Specifies the age of the files you want to remove. For example, if you<br />

specify 100 for days_old, all files that were last accessed 100 or more days<br />

ago are marked as candidates for deletion.<br />

directory<br />

Specifies the directory in which to look for files.<br />

By default, files are removed from the specified directory based on access time and<br />

their status as regular files, and are removed only from the directory specified (not<br />

from any subdirectories).<br />

586 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!