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
#!/bin/bash | |
# Set the root directory | |
CUR_DIR=/git/DTMS-Tools | |
cd $CUR_DIR | |
# Let the person running the script know what's going on. | |
echo -e "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
# Find all git repositories and update it to the master revision | |
for i in $(find . -name "*.git" | cut -c 3-); do | |
repo=$(echo $i | awk -F/ '{ print $1 }'); |
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
For one: kubectl delete pod <PODNAME> --grace-period=0 --force --namespace <NAMESPACE> | |
For Many: kubectl get pods --all-namespaces | grep Terminating | while read line; do | |
pod_name=$(echo $line | awk '{print $2}' ) name_space=$(echo $line | awk '{print $1}' ); kubectl delete pods $pod_name -n $name_space --grace-period=0 --force; |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
kubectl delete jobs --field-selector status.successful=1 |
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
kubectl patch pvc nextcloud -p '{"metadata":{"finalizers": []}}' --type=merge -n nextcloud |