Use Case:
# !/bin/bash
# Author: upadhyay.yogesh@gmail.com
# The host and port of the source server
SOURCE="localhost:4502"
# The user credentials on the source server (username:password)
SOURCE_CRED="admin:admin"
#Root path, You can change this path to target only author or publish agent
ROOT_PATH="/etc/replication"
ALL_PATHS=`curl -s -u $SOURCE_CRED "$SOURCE/bin/querybuilder.json?path=$ROOT_PATH&type=nt:unstructured&1_property=cq:template&1_property.value=/libs/cq/replication/templates/%&1_property.operation=like&2_property=enabled&2_property.value=true&p.limit=-1" | tr ",[" "\n" | sed 's/ /%20/g' | grep path | awk -F \" '{print $4 "\n"}'`
echo "$ALL_PATHS"
for SINGLE_PATH in $ALL_PATHS
do
curl -s -u $SOURCE_CRED -F"enabled=false" $SOURCE$SINGLE_PATH
done
If you already know replication agent name you can also do following,
for agent in flush flush1 {Other agent name}
- You want to disable replication agent without going to console.
- You are doing a production deployment and want to disable replication agent
- You want author not to replicate
- You want dispatcher not to get flush
# !/bin/bash
# Author: upadhyay.yogesh@gmail.com
# The host and port of the source server
SOURCE="localhost:4502"
# The user credentials on the source server (username:password)
SOURCE_CRED="admin:admin"
#Root path, You can change this path to target only author or publish agent
ROOT_PATH="/etc/replication"
ALL_PATHS=`curl -s -u $SOURCE_CRED "$SOURCE/bin/querybuilder.json?path=$ROOT_PATH&type=nt:unstructured&1_property=cq:template&1_property.value=/libs/cq/replication/templates/%&1_property.operation=like&2_property=enabled&2_property.value=true&p.limit=-1" | tr ",[" "\n" | sed 's/ /%20/g' | grep path | awk -F \" '{print $4 "\n"}'`
echo "$ALL_PATHS"
for SINGLE_PATH in $ALL_PATHS
do
curl -s -u $SOURCE_CRED -F"enabled=false" $SOURCE$SINGLE_PATH
done
If you already know replication agent name you can also do following,
for agent in flush flush1 {Other agent name}
do echo Disabling /etc/replication/agents.author/${agent}
curl -D- -o /dev/null -XPOST -F./enabled=false http://admin:admin@HOST:PORT/etc/replication/agents.author/${agent}/jcr:content 2>/dev/null done
Please test it before use.
Please test it before use.
I am a professional writer with experience in travel, career development, and personal empowerment. I studied creative writing and history at a sunny little liberal arts college in
ReplyDeleteFor more info visit: concierge service
Thank you very much for this article.
ReplyDeleteMovers and Packers in Pune
Movers and Packers in Gurgaon
Movers and Packers in Bangalore
Thank you very much for this article
ReplyDeletePackers and Movers Mumbai
Packers and Movers Navi Mumbai
Packers and Movers Thane
Packers and Movers Ghaziabad
Packers and Movers Faridabad
Packers and Movers Delhi
Packers and Movers Noida
now present in your city cara menggugurkan kandungan
ReplyDelete