Skip to content

Instantly share code, notes, and snippets.

@CesarCapillas
Last active May 16, 2017 21:43
Show Gist options
  • Save CesarCapillas/e20210485ae0854485fa821bb68f9fc1 to your computer and use it in GitHub Desktop.
Save CesarCapillas/e20210485ae0854485fa821bb68f9fc1 to your computer and use it in GitHub Desktop.
Alfresco Shell Scripts
$ curl --silent https://services.zylk.net/alfresco/service/api/sites |grep shortName|wc -l
31
In JS Console
var s = siteService.getSites("", "", 0);
s.forEach(function(entry) {
var members = entry.listMembers(null, "", 0, false);
for (userName in members) {
logger.log(entry.shortName+ " :: "+userName);
}
});
#! /bin/bash
# m h dom mon dow command
#0,15,30,45 * * * * /opt/alfresco/bin/check_libre.sh
ALF_HOME=/opt/alfresco
ALF_EXE=$ALF_HOME/alfresco.sh
ALF_LOG=$ALF_HOME/tomcat/logs/libreffice.log
ALF_DATE=`/bin/date`
if [[ -z `/bin/pidof ".soffice.bin"` ]]
then
$ALF_EXE start libreoffice
echo "$ALF_DATE" >> $ALF_LOG
fi
curl -o jmxdump.zip -u {admin_user}:{admin_password} http://{host}:{port}/alfresco/s/api/admin/jmxdump
$ printf '%s' "admin" | iconv -t utf16le | openssl md4
(stdin)= 209c6174da490caeb422f3fa5a7ae634
wget -r -nH -np -nv --cut-dirs=1 --user=<user> --password=<password> http://localhost:8080/alfresco/webdav/Sites/swsdp/documentLibrary
$ vim /etc/logrotate.d/alfresco
/opt/alfresco/tomcat/logs/catalina.out {
copytruncate
daily
rotate 10
missingok
dateext
size 50M
}
The crontab for your Alfresco user (owner of java process) should be like:
# 0 5 * * 1 /usr/sbin/logrotate /etc/logrotate.d/alfresco
#!/bin/bash
# Crontab for your Alfresco user (owner of java process)
# 0 5 * * 1 /opt/alfresco/bin/zk-clean-logs.sh
ALF_HOME=/opt/alfresco
LOGS_TOM=$ALF_HOME/tomcat/logs
LOGS_DAYS=14
find ${LOGS_TOM}/* -mtime +${LOGS_DAYS} -name \*.log\* -delete 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment