I want to write simple script to copy/backup directory then remove on server startup. So something like this:
TC_DIR=${SERVER_HOME}/terracotta
CLUSTER_STAT_DIR=${TC_DIR}/cluster-stat
cp ${CLUSTER_STAT_DIR} ${TC_DIR}/old.cluster-stat
rm ${CLUSTER_STAT_DIR}
Thanks for help guys.
I believe what you have done should work with the only addition that you need to pass -r options to both cp and rm as you are dealing with directories. Try this:
EDIT: if your question is how to execute that on startup take a look here.