I have been using wsusoffline for several months and just now realized that superseded patches are not being deleted from the client folder.
I am currently running wsusoffline v9.4.2
I looked thru the subversion repo and found that in wsusoffline 8.0, the cleanup function changed so that it simply echos text to a file (../temp/cleanup.txt) instead of actually deleting the superseded patches from the client directory.
Is there a reason why this change was made? How can I set up my cron jobs so that superseded patches will automatically be deleted from the client directory?
wsusoffline 7.5
- Code: Select all
cleanup()
{
file="$1"
path="$2"
rm -f ../temp/cleanup.txt
touch ../temp/cleanup.txt
for i in $(ls -l "$path" | tr -s " " | cut -d " " -f 9 | grep "\b"); do
result=$(grep "${i}" "${file}")
if [ "$result" == "" ] && [ "$i" != "ie6setup" ]; then
echo "$i" >> ../temp/cleanup.txt
fi
done
currentpath=$(pwd)
cd "$path"
rm -f `cat "$currentpath/../temp/cleanup.txt"`
cd "$currentpath"
}
wsusoffline 8.0
- Code: Select all
cleanup()
{
file="$1"
path="$2"
rm -f ../temp/cleanup.txt
touch ../temp/cleanup.txt
for i in $(ls "$path"); do
test "$i" == "ie6setup" && continue
grep "${i}" "${file}" || echo "$i"
echo rm -f ${path}/"$i"
done > ../temp/cleanup.txt
}