Last active
May 16, 2017 21:43
-
-
Save CesarCapillas/e20210485ae0854485fa821bb68f9fc1 to your computer and use it in GitHub Desktop.
Alfresco Shell Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -o jmxdump.zip -u {admin_user}:{admin_password} http://{host}:{port}/alfresco/s/api/admin/jmxdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ printf '%s' "admin" | iconv -t utf16le | openssl md4 | |
(stdin)= 209c6174da490caeb422f3fa5a7ae634 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -r -nH -np -nv --cut-dirs=1 --user=<user> --password=<password> http://localhost:8080/alfresco/webdav/Sites/swsdp/documentLibrary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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