[jbosstools-commits] JBoss Tools SVN: r42064 - trunk/build/util.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Mon Jun 18 14:51:39 EDT 2012
Author: nickboldt
Date: 2012-06-18 14:51:38 -0400 (Mon, 18 Jun 2012)
New Revision: 42064
Added:
trunk/build/util/purgeRemoteFiles.sh
trunk/build/util/purgeRemoteFolders.sh
Log:
add two scripts to purge remote files over sftp/rsync (to clean up download.jboss.org) JBIDE-12208
Added: trunk/build/util/purgeRemoteFiles.sh
===================================================================
--- trunk/build/util/purgeRemoteFiles.sh (rev 0)
+++ trunk/build/util/purgeRemoteFiles.sh 2012-06-18 18:51:38 UTC (rev 42064)
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# first need a list of files to purge, like this:
+#
+#tools/updates/requirements/testng/.gitignore
+#tools/updates/requirements/swtbot/.gitignore
+
+# can get such a file like this:
+# rsync -Pr --rsh=ssh --protocol=28 $TOOLS -f "+ */" -f "+ .git*" -f "- *" | tee ~/tmp/dotsvn.files.list.txt
+# then clean out file metadata (sed -i "s#.+ tools/#tools/#g" file)
+# then purge all but the files you want (eg., .gitignore)
+
+DESTINATION=tools at filemgmt.jboss.org:/downloads_htdocs/
+inputfile=/home/nboldt/tmp/dotsvn.files.list.grepped.txt
+if [[ $1 ]]; then inputfile=$1; fi
+
+for l in $(cat ${inputfile}); do
+ echo "$l ...";
+ # make it editable
+ echo "chmod 777 $l" | sftp ${DESTINATION}
+ # remove the now-empty dir
+ echo "rm $l" | sftp ${DESTINATION}
+done
Property changes on: trunk/build/util/purgeRemoteFiles.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/build/util/purgeRemoteFolders.sh
===================================================================
--- trunk/build/util/purgeRemoteFolders.sh (rev 0)
+++ trunk/build/util/purgeRemoteFolders.sh 2012-06-18 18:51:38 UTC (rev 42064)
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# first need a list of folders to purge, like this:
+#
+#tools/builds/staging/_composite_/soa-tooling/3.3.0.Nightly/.svn
+#tools/builds/staging/_composite_/soa-tooling/3.3.0.Beta1/.svn
+#tools/builds/staging/_composite_/soa-tooling/3.3.0.Beta2/.svn
+
+# can get such a file like this:
+# rsync -Pr --rsh=ssh --protocol=28 $TOOLS -f "+ */" -f "+ .svn" -f "+ .git*" -f "- *" | tee ~/tmp/dotsvn.files.list.txt
+# then clean out file metadata (sed -i "s#.+ tools/#tools/#g" file)
+# then purge all but the parent dirs you want (.svn, but not .svn/tmp)
+
+
+DESTINATION=tools at filemgmt.jboss.org:/downloads_htdocs/
+inputfile=/home/nboldt/tmp/dotsvn.folders.list.grepped.txt
+if [[ $1 ]]; then inputfile=$1; fi
+
+tmpdir=/tmp/purgeRemoteFolders.sh.empty
+mkdir ${tmpdir}
+pushd ${tmpdir} >/dev/null
+
+for l in $(cat ${inputfile}); do
+ echo "$l ...";
+ # make it editable
+ echo "chmod 777 $l" | sftp ${DESTINATION}
+ # empty the target folder
+ rsync -rPz --rsh=ssh --protocol=28 --delete ${tmpdir}/ ${DESTINATION}/$l/
+ # remove the now-empty dir
+ echo "rmdir $l" | sftp ${DESTINATION}
+done
+
+popd >/dev/null
+rm -fr ${tmpdir}
Property changes on: trunk/build/util/purgeRemoteFolders.sh
___________________________________________________________________
Added: svn:executable
+ *
More information about the jbosstools-commits
mailing list