The cleanup.sh script doesn’t work when being executed from the cron tab. When it is executed manually, the files get cleaned up normally as expected.
This is caused by the script picking up an incorrect JAVA_HOME or PATH if there are multiple versions of Java installed.
JAVA_HOME
PATH
There are three possible solutions to this problem. The first should be to remove the old versions of Java and update both the PATH and JAVA_HOME variable to ensure that the right value gets picked up. If this still doesn’t address it, one can use either of the following solutions.
The cron job would look like the following:
$ crontab -l JAVA_HOME=/PATH_TO_JAVA_HOME * * * * * /../../../cleanup.sh
cleanup.sh
#!/bin/bash pushd dirname $0 > /dev/null . exports.sh . exports-ant.sh export JAVA_HOME=/PATH_TO_JAVA_HOME
dirname $0
In the two methods above, you have to modify the /PATH_TO_JAVA_HOME value to the actual path of the most updated Java installation.
/PATH_TO_JAVA_HOME
This article applies to all versions of Appian using Linux as the OS.
Last Reviewed: February 2017