purgetemp

Package: WA2L/edrc 1.5.57
Section: Library Commands (3)
Updated: 27 May 2022
Index Return to Main Contents

 

NAME

purgetemp - purge temporary directories created by maketemp

 

SYNOPSIS

edrc/lib/purgetemp [ -h ]

purgetemp [ -s scriptname ] [ -q ] -d directory

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

purge (=remove) all temporary directories that have the state IS_ACTIVE=False starting at a given directory ( as listed by listtemp -d directory ) created by maketemp(3).

Directories not created by maketemp will not be removed by the purgetemp command.

Use the listtemp(3) command to list the state of temporary directories created by maketemp.

 

OPTIONS

-h
usage message.

-s scriptname
scriptname in message output of purgetemp.

-q
quiet, no message output.

-d directory
temporary base directory as specified in the listtemp command.

See section EXAMPLES for additional information.

 

ENVIRONMENT

-

 

EXIT STATUS

0
no error.

3
specified temporary base directory does not exist.

4
usage message listed.

 

FILES

<directory>/
temporary base directory to be purged.

<directory>/<tempdir>/.maketemp.flagfile
flagfile containing the state information about the command that created the temporary directory. This file is created by the maketemp(3) command while creating the temporary directory and read by purgetemp(3) and listtemp(3).

 

EXAMPLES

1) purge tempdirs created in '/tmp':

[ /root ]
[ root@acme001 ][-sh]: maketemp -d /tmp/.example
/tmp/.example.3430.2Hpt0D/

[ /root ]
[ root@acme001 ][-sh]: purgetemp -d /tmp

 

SEE ALSO

edrcintro(1), listtemp(3), maketemp(3), removetemp(3)

 

NOTES

-

 

BUGS

if the tempdir is created in a temporary directory location where a regular file cleanup is configured, purgetemp will not be able to purge the directory specified in the -d option, due to the fact that the .maketemp.flagfile might be removed by the cleanup function.

Cleanup crontab entry that would cause the behaviour described:

#
# delete all files in /tmp which are older than one week
#
00 1 * * * find /tmp \( -mtime +7 -a -type f \) -exec /bin/rm {} \;

 

AUTHOR

purgetemp was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2022 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 16:54:08 GMT, August 28, 2024