http://middlewaremagic.com/jboss/?p=2534
https://www.openshift.com/page/openshift-environment-variables
https://www.openshift.com/forums/openshift/log-rotation-not-enabled
https://bugzilla.redhat.com/show_bug.cgi?id=917294
1) stoppare tutti i servizi:
source /usr/bin/rhcsh
ctl_all stop
1) purgare la cartella dei log di php + vecchi di 3 giorni e la cartella dei files tmp
#!/bin/bash
cd $OPENSHIFT_PHP_LOG_DIR
find . -type f \( -name access_log-\* -or -name error_log-\* \) -mtime +3 | xargs tar -czvf backup_logs-$(date +%Y%m%d).tar.gz
find . -type f \( -name access_log-\* -or -name error_log-\* -or -name backup_log-\* \) -mtime +3 -exec rm {} \;
cd $OPENSHIFT_MYSQL_DB_LOG_DIR
find . -type f \( -name access_log-\* -or -name error_log-\* \) -mtime +3 | xargs tar -czvf backup_logs-$(date +%Y%m%d).tar.gz
find . -type f \( -name access_log-\* -or -name error_log-\* -or -name backup_log-\* \) -mtime +3 -exec rm {} \;
cd /tmp
rm -f *
2) ricreare i link simbolici nella cartella root del server php (dato che tutti i files stanno nella cartella DATA) usando ciclo for
4) riavviare tutti i servizi
source /usr/bin/rhcsh
ctl_all start