목록* 스크립트 (16)
변군이글루

DB 백업 스크립트 dbbackup.sh 편집 $ vim dbbackup.sh #!/bin/bash DB_USER=root DB_PASSWD=dbpasswd ZDB_NAME=zabbix_db RDB_NAME=racktables_db DB_BACKUP_DIR=/backup_dir MYSQL=`which mysql` MYSQLDUMP=`which mysqldump` ###데이터베이스를 모두 백업할 경우 ${MYSQLDUMP} --user=${DB_USER} --password=${DB_PASSWD} --all-databases | gzip > "${DB_BACKUP_DIR}/full_backup-$(date +%Y%m%d).gz"; ###데이터베이스를 백업할 경우 ${MYSQLDUMP} --user=${DB..

운영체제 및 gcc 버전 체크 스크립트 gv.sh 편집 $ vim gv.sh #!/bin/bash echo -n "운영체제 버전 => " if [ -f /etc/redhat-release ]; then cat /etc/redhat-release elif [ -f /etc/os-release ]; then cat /etc/lsb-release | grep DISTRIB_DESCRIPTION | cut -d"=" -f2 | cut -d"\"" -f2 else echo "Other" fi echo -n "BIT => " getconf LONG_BIT echo -n "kernel version => " uname -r echo "--" echo "GCC Compiler 버전" echo "gcc version =..

bash colors 스크립트 편집 $ vim z.sh #!/bin/bash color_reset=$(tput sgr0) color_red=$(tput setaf 1) color_blue=$(tput setaf 4) echo "${color_red}sangchul.kr${color_reset}" echo "${color_blue}sangchul.kr${color_reset}" 스크립트 실행 결과 tput 명령어 사용 $ echo "블로거 `tput setaf 1`sangchul.kr`tput sgr0`." bash 프로파일에 등록하여 컬러 사용하기 $ vim .bashrc $ vim .bashrc RED="\033[0;31m" PINK="\033[1;31m" YELLOW="\033[1;33m" GREEN..

리눅스 패스워드 변경 스크립트 스크립트 다운로드 $ git clone https://github.com/anti1346/password-change.git pwch 스크립트 실행 $ cd pwch $ ./pwch.sh user1 user2 anti1346/password-change password change script. Contribute to anti1346/password-change development by creating an account on GitHub. github.com