Created
October 12, 2012 08:14
-
-
Save jonathanbp/3877950 to your computer and use it in GitHub Desktop.
Copying entities from one server to another.
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 "$1/$3?depth=0" | xmllint --format - | grep Id | sed 's/<Id>\(.*\)<\/Id>/\1/' | sort | uniq | tr -s ' ' | sed 's/^ *//g' | while read img_id ; do | |
curl "$1/$3/$img_id" | xmllint --format - | egrep -v "(Lamport|LastModified)" > tmpimg.xml | |
curl -X PUT -d @tmpimg.xml "$2/$3/$img_id" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl "$1/$3?depth=0" | xmllint --format - | grep Id | sed 's/(.*)</Id>/\1/' | sort | uniq | tr -s ' ' | sed 's/^ *//g' | while read img_id ; do
curl "$1/$3/$img_id" | xmllint --format - | egrep -v "(Lamport|LastModified)" | curl -X PUT -d - "$1/$2/$img_id"
done