In some earlier versions of CS there is an issue whereby if an editor does not provide a comment with their action, a 0-byte or 1-byte file is still created anyway. If workflow is heavily used, then many of these files may be created, causing:
- consumption of inodes on the shared disk
- performance impact, as some workflow tags used by the UI will read these files whilst checking assignments
This issue is resolved from CS 7.5.0 patch 5 onwards, 0-byte and 1-byte files are no longer created although though the fix will not remove any existing ones.
It is possible to remove these 0-byte and 1-byte files, but since references exist to them from the Assignment table, you must remove those references too. Here is a script that can clean them up. Take a full backup first, then change ‘workflowdir’ in the script to point to the correct workflow folder. The script will output two things:
- A SQL script "aupdate.sql" to run on the db, that will remove the references to the 0-byte and 1-byte files
- Another shell script "adelete.sh" that will actually delete 0-byte and 1-byte files
#!/bin/sh
workflowdir=/home/csuser/Shared/workflow
rm -f /tmp/aupdate.sql
rm -f /tmp/adelete.sh
cd $workflowdir
find . -size 0c > /tmp/0bytelist
find . -size 1c > /tmp/1bytelist
for i in `cat /tmp/0bytelist /tmp/1bytelist`; do
filename=`echo $i | cut -c3-`
echo "update Assignment set urlassigncomment = '' where urlassigncomment = '$filename' " >> /tmp/aupdate.sql
echo "update Assignment set urlgroupcomment = '' where urlgroupcomment = '$filename' " >> /tmp/aupdate.sql
echo "update Assignment set urlclearcomment = '' where urlclearcomment = '$filename' " >> /tmp/aupdate.sql
echo "rm -f $workflowdir$filename" >> /tmp/adelete.sh
done
echo Found `wc -l /tmp/0bytelist` 0-byte files in workflow
echo Found `wc -l /tmp/1bytelist` 1-byte files in workflow
echo Run /tmp/aupdate.sql in sqlplus
echo Run /tmp/adelete.sh in the shell