[ Linux ] Crontab 예제 * * * * * 분(0-59) 시간(0-23) 일(1-31) 월(1-12) 요일(0-7) 표현식 설명 @reboot Rebooting시 실행 10 0 * * * 매일 0시 10분 */10 * * * * 10분 마다 0 9 * * 1-5 월 ~ 금 09시 ( 0 : 일요일, 1 : 월요일, 2 : 화요일, 3 : 수요일, 4 : 목요일, 5 : 금요일, 6 : 토요일) Linux/RedHat, CentOS, ubuntu 2022.10.31
[ Linux ] timedatectl 명령어를 이용한 한국 타임존 변경 한국 타임존 변경 $ sudo timedatectl set-timezone Asia/Seoul 변경 확인 $ timedatectl Local time: Tue 2022-09-27 20:18:36 KST Universal time: Tue 2022-09-27 11:18:36 UTC RTC time: Tue 2022-09-27 11:18:37 Time zone: Asia/Seoul (KST, +0900) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: n/a Linux/RedHat, CentOS, ubuntu 2022.09.27
[ Linux ] fallocate 명령어 (임의크기 파일 만들기 명령어) 백업 등 특정 파일을 가지고 테스트를 해볼 때, fallocate 명령어는 유용하게 사용할 수 있다. 생성된 파일내용은 없으며, 크기만 할당된다. 1. 10Byte 크기의 파일을 생성하기 $ fallocate -l 10 file # -l : 지정한 크기만큼의 용량의 파일 만들기 (Byte) $ ls -l file .... .... 10 Feb 27 15:30 file $ fallocate -l 10k file # 10 kilo Bytes $ fallocate -l 10m file # 10 Mega Bytes $ fallocate -l 10g file # 10 Giga Bytes Linux/RedHat, CentOS, ubuntu 2022.02.28
[ CentOS 7 ] freetds를 이용하여 MSSQL에 연결 freetds : MSSQL과 통신을 할 수 있는 리눅스 라이브러리 패키지 설치 # yum install freetds unixODBC /etc/freetds.conf 수정 [mssql] host = x.x.x.x Port = 1433 tds version = 8.0 tsql을 이용하여 접속 테스트 # tsql -S 'x.x.x.x' -U sa Password: locale is "en_US.UTF-8" locale charset is "UTF-8" using default charset "UTF-8" 1> select @@version 2> go Microsoft SQL Server 2012 ..... Linux/RedHat, CentOS, ubuntu 2021.04.02
apache httpd.conf 문법 검사 명령어 # /usr/sbin/apachectl configtest Syntax OK OK가 나오면 정상 Linux/RedHat, CentOS, ubuntu 2021.03.26
[CentOS] timezone 변경하기 리눅스 타임 시간이 계속 맞지 않아서 date로 확인을 해보니 EDT (뉴욕이었다.) 수동으로 한국시간으로 변경해도 도루묵이다. 이 때는 타임존을 변경해주어야 한다. # date Tue Mar 24 12:16:48 EDT 2020 [ Asia/Seoul로 변경 ] # ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime # date Wed Mar 25 01:17:36 KST 2020 Linux/RedHat, CentOS, ubuntu 2020.03.24
CentOS7 mariadb port 변경 /etc/my.cnf.d/server.cnf 파일에서 [mysqld] 섹션에 port=변경할포트 SElinux가 활성화 되어 있다면 포트추가 # semanage port -a -t mysqld_port_t -p tcp [변경할포트] # semanage port -l | grep mysqld_port_t mysqld_port_t tcp [변경할포트], 1186, 3306, 63132-63164 방화벽 설정이 되어 있다면, 방화벽을 추가하고, 데몬을 재기동 Linux/RedHat, CentOS, ubuntu 2020.01.31
[ CentOS ] python3로 변경 후 YUM 실행시 SyntaxError: invalid syntax 원인과 해결 방법 python3로 업그레이드 한 후 YUM을 실행했을 때, 에러가 발생하였다. 원인 /usr/bin/yum의 파일을 열어보니, import yum을 하였을시 예외처리가 되어 있었다. python3에는 모듈이 없나보다. #!/usr/bin/python import sys try: import yum except ImportError: print >> sys.stderr, """\ There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: %s Please install a package which provides this module, or verify that.. Linux/RedHat, CentOS, ubuntu 2019.12.20
CentOS 7 포트를 사용하는 데몬(프로세스)명 확인하기 예를 들어 서버에서 631포트가 LISTEN 상태로 되어 있고, 어떤 데몬(프로세스)가 사용하고 있는지 확인 netstat 명령어로 포트와 사용하는 프로세스 확인 # netstat -tnlp | egrep ':631' tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1382/cupsd tcp6 0 0 ::1:631 :::* LISTEN 1382/cupsd - cupsd : Common UNIX Printing System (프린터 서버) pstree 명령어로 프로세스 상관관계 확인 (pstree가 설치되어 있지 않으면, yum -y install psmisc으로 설치) # pstree systemd─┬─ModemManager───2*[{ModemManager}] ├─NetworkMa.. Linux/Security 2019.12.11
[리눅스 명령어] tee 표준입력으로부터 표준출력과 파일로 저장 어떤 명령어의 결과를 표준출력과 파일 저장을 같이 하고 싶을 때, 사용하는 명령어의 결과를 로깅파일로 만들 때, 유용하다. 실행결과를 표준출력과 파일로 저장 $ echo 'this is tee command' | tee tee.log this is tee command $ cat tee.log this is tee command 실행결과를 표준출력과 파일로 저장. ( -a 옵션을 사용하여 append(추가하기)) $ echo 'this is tee command1' | tee -a tee.log this is tee command1 $ echo 'this is tee command2' | tee -a tee.log this is tee command2 $ cat tee.log this is tee com.. Linux/RedHat, CentOS, ubuntu 2019.11.25