Category Archives: Scripts

Basics of wsadmin tool

The WebSphere administrative (wsadmin) scripting program is a powerful, non-graphical command interpreter environment enabling you to run administrative operations in a scripting language. The wsadmin tool is intended for production environments and unattended operations. The wsadmin tool provides: Scripting capabilities … Continue reading

Posted in Scripts, WebSphere Application Server | Tagged , , | Leave a comment

Map Java EE application security roles to groups in WebSphere Application Server

Assume we have a Java web app in which we have two servlets Staff and Student. Staff servlet is suppose to be accessed by members of group All-Staff and Student servlet by members of All-student group. Those groups are defined … Continue reading

Posted in Java, Scripts, WAS | Tagged , , | Leave a comment

Export URL Mappings in WebSphere Portal using xmlaccess

1. Following samples shows to export url mapping inside base portal: script1.xml: <?xml version=”1.0″ encoding=”UTF-8″?> <request type=”export” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xsi:noNamespaceSchemaLocation=”PortalConfig_1.4.xsd”> <portal action=”locate”> <url-mapping-context action=”export” objectid=”*” /> </portal> </request> Script2.xml Following script will export page2 which is nested inside page1 urlmpping: <?xml … Continue reading

Posted in Scripts, WebSphere Portal | Leave a comment

Linux shell scripting basics

Strings:  == equal; != Not equal, -z Null/empty/zero length; -n NOT empty/null Number: eq Equal; -ne Not equal; -gt Greater than; -lt Less than; -ge Greater than or Equal to; -le Less than or Equal to Files: -e file exist; -f is a file; -d is a directory; -s file exists … Continue reading

Posted in LFCE, LFCS, Linux, Scripts | Leave a comment

Backup WP DB2 databases

curDate=`date +%d%m%y_DBs_WP615` cd /opt/Backups/databases/temp echo “Backing-up fdbkdb into /opt/Backups/databases/temp directory…” su – db2inst1 -c “db2 backup db fdbkdb” echo “Backing-up lmdb into /opt/Backups/databases/temp directory…” su – db2inst1 -c “db2 backup db lmdb” echo “Backing-up cusdb into /opt/Backups/databases/temp directory…” su – … Continue reading

Posted in DB2, Linux, Scripts, WebSphere Portal | Leave a comment

Archive a directory using tar with current date

1. Backup “WebSphere” directory: tar -C /opt/IBM -zpcvf /tmp/WebSphere.tar.gz  WebSphere tar -tvf /tmp/WebSphere.tar.gz 2. Restore “WebSphere” directory: mv /opt/IBM/WebSphere /opt/IBM/WebSphere_org (Note: Before restoring rename existing WebSphere directory) tar -C /opt/IBM -pxvf /tmp/WebSphere.tar.gz diff -r /opt/IBM/WebSphere /opt/IBM/WebSphere_org (Compare files between restored … Continue reading

Posted in Linux, Scripts, WAS, WebSphere Portal | Leave a comment

Restart WP and archive logs

echo “Stoping WebSphere_Portal server…” /opt/IBM/WebSphere/AppServer/bin/stopServer.sh WebSphere_Portal echo “Archiving WebSphere_Portal logs…” mv -f /opt/IBM/WebSphere/wp_profile/logs/WebSphere_Portal/*.* /opt/IBM/WebSphere/wp_profile/logs/WebSphere_Portal/archive echo “Starting WebSphere_Portal server…” /opt/IBM/WebSphere/AppServer/bin/startServer.sh WebSphere_Portal

Posted in Linux, Scripts, WebSphere Portal | Leave a comment