OnDemand User Group
Support Forums => z/OS Server => Topic started by: chuckalugk on December 04, 2020, 09:49:29 AM
-
Does anyone have a job they can share that deletes out the files in a /tmp directory in USS? I found my /tmp directory had 5900 files in it.
-
If you have unix-style commands available to you, and the cron scheduling tool, you can configure cron to run this command daily, which deletes files that were created x days ago:
find /tmp/ -name FILESPEC -ctime +x rm -f {} \;
PLEASE BE EXTRAORDINARILY CAUTIOUS WITH THIS COMMAND, AS IT FORCES FILES TO BE DELETED.
Set FILESPEC to the file specification you want to use ("*.AOD") and 'x' to the number of days you want files to exist.
-JD.
-
We have a CRON job/command that performs clanup automatically for any file older than 7-days (-mtime +7).
0 0 * * * find /tmp/ -type f -mtime +7 -exec rm -v {} \; > /tmp/tmp_rm.txt &