Hello,
I wrote a short script whose purpose to use cleanwork to delete temporary files from the disk.
#! /bin/sh
SERVER=`hostname -s`
start_date_tm=$(date +'%Y-%m-%d_%H:%M:%S')
/opt/sas/install/SASHome/SASFoundation/9.4/utilities/bin/cleanwork /saswork1 -n -v -hostmatch -log /opt/sas/system_logs/cleanwork_log/cleanwork_${SERVER}_${start_date_tm}.log
When I ran the script with root user on the server, I received the error:
/opt/sas/system_logs/cleanwork_log/cleanwork_sas04_2026-01-29_15:01:16.log : No such file or directory
I checked and all the folders were created before running the script.
My goal in the first stage is to have all the files that are supposed to be deleted recorded in the log file because of using the -n option.
I would appreciate guidance on what needs to be changed.