Skip to content

Instantly share code, notes, and snippets.

@gjabouley-invn
Last active June 18, 2019 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gjabouley-invn/6b9d18cd6403f89ee8ca12fe1e532357 to your computer and use it in GitHub Desktop.
Save gjabouley-invn/6b9d18cd6403f89ee8ca12fe1e532357 to your computer and use it in GitHub Desktop.
Jenkins filesystem fixes
# Jenkins symlinks becoming folders: https://support.cloudbees.com/hc/en-us/articles/216227047-After-moving-a-job-symlinks-for-folders-became-actual-folders
find $JENKINS_BUILDS_FOLDER -type d \( -name "last*Build" -o -name "lastStable" -o -name "lastSuccessful" \) -exec echo Directory: {} \;
find $JENKINS_BUILDS_FOLDER -type d \( -name "last*Build" -o -name "lastStable" -o -name "lastSuccessful" \) -exec mv {} {}.err \;
find $JENKINS_BUILDS_FOLDER -type d -name "*.err" -exec rm -rf {} \;
# Change ownership to bitnami of all folders being member of root group (not recursive)
find . -maxdepth 1 -group root -exec sudo chown -hR bitnami:bitnami {} \;
find . -maxdepth 1 -group root -exec sudo chown -hR jenkins:staff {} \;
# Batch rename/prefix
find eMD-Daily* -maxdepth 0 -exec mv {} OLD_{} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment