Hello,
Running SAS v9.4 (TS1M5)
Studio is Release: 3.71 (Enterprise Edition)
We recently had an issue with users who could not login to SAS Studio due to insufficient space in /sasconfig. SAS support helped us correct the issue, which was excessive log build up in several subdirectories under /sasconfig. While I understand that it is important to have logs for numerous reasons, there doesn't appear to be a uniform process for cleaning out and/or archiving those logs using a management tool that could be based on date (e.g., delete if file date > 30 days from today) or other filters.
To this end, I'm planning to develop a Unix system script with our Sys Admin to parse through the directories that SAS Support recommended for clean-up. My current plan is to run this quarterly in crontab as sasinst and use a 30 day filter as mentioned above.
Has anyone else had to go through this? Any helpful hints? Are there any other methods for doing this that I haven't thought about?
Thanks for your time!
I have created a script (on AIX) to clear most of this out on a monthly basis. The script is run on every 28th of a month, so it more or less uses a similar window:
ARCFILE=/home/root/log/filelist_sasconf_`/usr/linux/bin/date +%Y%m`
echo > $ARCFILE
DATUM=`/usr/linux/bin/date --date="1 month ago" +%Y-%m`
rm -r /sasconf/Lev1/Backup/Results/${DATUM}*
rm -r /sasconf/Lev1/Backup/Logs/${DATUM}*
find /sasconf -name \*${DATUM}\* >> $ARCFILE
DATUM=`/usr/linux/bin/date --date="1 month ago" +%Y%m`
find /sasconf -name \*${DATUM}\* >> $ARCFILE
dsmc archive -filelist=$ARCFILE -deletefiles description="XXXXX" >> /home/root/log/archive_sasconf.log
It uses both date-stamp formats found in SAS log files; some of the files are simply removed (because irrelevant), and some are moved to the long-time archive. The final command starts the commandline client of IBM Tivoli Storage Manager (TSM).
Use the {i} button for posting such scripts. This usually keeps the original format.
If it still fails to keep the linefeeds, open the script file with notepad++ or similar and do a copy/paste from there.
# Run SAS services status command --- Send output to script log for delivery once completed /sasconfig/Lev1/sas.servers status # Run SAS services stop command --- Send output to script log for delivery once completed /sasconfig/Lev1/sas.servers stop echo 'CleanUp_Studio_Web_Logs.scr' echo echo 'Cleaning -- /sasconfig/Lev1/Web/WebAppServer/SASServer1_1/' echo find /sasconfig/Lev1/Web/WebAppServer/SASServer1_1/logs/ -mtime +30 -print0 | xargs -0 rm -f -v find /sasconfig/Lev1/Web/WebAppServer/SASServer1_1/work/ -mtime +30 -print0 | xargs -0 rm -f -v find /sasconfig/Lev1/Web/WebAppServer/SASServer1_1/temp/* -print0 | xargs -0 rm -r -f -v find /sasconfig/Lev1/Web/WebAppServer/SASServer1_1/work/Catalina/localhost/* -print0 | xargs -0 rm -r -f -v echo echo 'Cleaning -- /sasconfig/Lev1/Web/WebAppServer/SASServer11_1/' echo find /sasconfig/Lev1/Web/WebAppServer/SASServer11_1/logs/ -mtime +30 -print0 | xargs -0 rm -f -v find /sasconfig/Lev1/Web/WebAppServer/SASServer11_1/work/ -mtime +30 -print0 | xargs -0 rm -f -v find /sasconfig/Lev1/Web/WebAppServer/SASServer11_1/temp/* -print0 | xargs -0 rm -r -f -v find /sasconfig/Lev1/Web/WebAppServer/SASServer11_1/work/Catalina/localhost/* -print0 | xargs -0 rm -r -f -v echo echo 'Cleaning -- /sasconfig/Lev1/Web/WebAppServer/SASServer2_1/' echo find /sasconfig/Lev1/Web/WebAppServer/SASServer2_1/logs/ -mtime +30 -print0 | xargs -0 rm -f -v find /sasconfig/Lev1/Web/WebAppServer/SASServer2_1/work/ -mtime +30 -print0 | xargs -0 rm -f -v find /sasconfig/Lev1/Web/WebAppServer/SASServer2_1/temp/* -print0 | xargs -0 rm -r -f -v find /sasconfig/Lev1/Web/WebAppServer/SASServer2_1/work/Catalina/localhost/* -print0 | xargs -0 rm -r -f -v echo echo 'Cleaning -- /sasconfig/Lev1/Web/WebServer/logs/' echo find /sasconfig/Lev1/Web/WebServer/logs/ -mtime +30 -print0 | xargs -0 rm -f -v echo echo 'Cleaning -- /sasconfig/Lev1/Web/gemfire/instances/ins_41415/ --> *.log & *.dat' echo find /sasconfig/Lev1/Web/gemfire/instances/ins_41415/*.log -mtime +30 -print0 | xargs -0 rm -f -v find /sasconfig/Lev1/Web/gemfire/instances/ins_41415/*.dat -mtime +30 -print0 | xargs -0 rm -f -v echo echo 'Cleaning -- /sasconfig/Lev1/Web/activemq/data/' echo find /sasconfig/Lev1/Web/activemq/data/* -print0 | xargs -0 rm -r -f -v echo echo 'Cleaning -- /sasconfig/Lev1/Web/Logs/SASServer1_1/ ../SASServer11_1/ ../SASServer2_1/' echo find /sasconfig/Lev1/Web/Logs/SASServer1_1/* -mtime +30 -print0 | xargs -0 rm -f -v find /sasconfig/Lev1/Web/Logs/SASServer11_1/* -mtime +30 -print0 | xargs -0 rm -f -v find /sasconfig/Lev1/Web/Logs/SASServer2_1/* -mtime +30 -print0 | xargs -0 rm -f -v echo echo 'I Declare These Directories Cleansed' echo # Run SAS services start command --- Send output to script log for delivery once completed /sasconfig/Lev1/sas.servers start # Run SAS services status command --- Send output to script log for delivery once completed /sasconfig/Lev1/sas.servers status
Yep, {i} works. Opened the .txt with PSPad and did a copy/paste.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
Learn how to explore data assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.