본문 바로가기
728x90
728x90

전체 글117

[Spring; 스프링] @Profile 어노테이션 `@Profile` 어노테이션은 Spring Framework 에서 빈(Bean)이나 설정 클래스가 특정 환경 프로파일(profile)에서만 활성화되도록 지정하는 데 사용됩니다. 프로파일은 특정 환경 (예: 개발, 테스트, 운영)에 대한 설정을 분리하여 관리할 때 유용합니다. 예를 들어, 개발 환경에서 사용되는 설정을 분리하고 싶을 때 `@Profile("dev")` 어노테이션을 사용하여 해당 빈이나 설정 클래스를 특정 프로파일에서만 활성화 할 수 있습니다. @Configuration @Profile("dev") public class DevelopmentConfig { // 개발 환경에서 사용할 빈들의 설정 } 위의 코드에서 `DevelopmentConfg` 클래스는 `@Profile("dev")` 어.. 2023. 10. 24.
[Spring; 스프링] Swagger 설정 Spring Boot 프로젝트에서 Swagger를 설정하는 방법은 다음과 같습니다. 1. Maven 또는 Gradle 의존성 추가 Maven: io.springfox springfox-boot-starter 3.0.0 Gradle: implementation 'io.springfox:springfox-boot-starter:3.0.0' // 현재 사용 가능한 최신 버전으로 업데이트하세요 2. Swagger 설정 클래스 생성 import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.ApiInf.. 2023. 10. 24.
[Linux; 리눅스] Linux / 리눅스 / Crontab / 크론탭 / 시간 예제 소프트웨어 유틸리티 cron은 유닉스 계열 컴퓨터 운영 체제의 시간 기반 잡 스케줄러이다. 소프트웨어 환경을 설정하고 관리하는 사람들은 작업을 고정된 시간, 날짜, 간격에 주기적으로 실행할 수 있도록 스케줄링하기 위해 cron을 사용한다. cron은 셸 명령어들이 주어진 일정에 주기적으로 실행하도록 규정해놓은 crontab (cron table) 파일에 의해 구동된다. crontab 파일들은 잡 목록 및 cron 데몬에 대한 다른 명령들이 보관된 위치에 저장되어 있다. 사용자들은 자신들만의 개개의 crontab 파일들을 가질 수 있으며, 가끔은 /etc 또는 /etc 하위 디렉터리에 시스템 관리자들만이 편집할 수 있는, 시스템 전반에 영향을 미치는 crontab 파일이 존재하는 경우도 있다. ( 예제 ).. 2023. 10. 24.
[Linux; 리눅스] 서비스 상태 확인 / 시작 / 중지 / 재시작 명령 [ 카페 24 ] 시작: /opt/apache/bin/apachectl start 재시작: /opt/apache/bin/apachectl restart 중지: /opt/apache/bin/apachectl stop 시작: /opt/mysql/support-files/mysql.server start 재시작: /opt/mysql/support-files/mysql.server restart 중지: /opt/mysql/support-files/mysql.server stop 우분투 Ubuntu 명령어 systemctl service /etc/init.d/ 상태 확인 systemctl status apache2 service apache2 status /etc/init.d.. 2023. 10. 24.
[Ubuntu; 우분투] 서비스 목록 우분투에서 서비스 목록을 보고싶으면 service --status-all 명령어를 쓰면 볼 수 있습니다. [ + ] : 현재 실행 중인 서비스 (Running) [ - ] : 현재 중지된 서비스 (Stopped) 현재 실행중인 서비스만 보고싶으면 service --status-all | grep + 이렇게 grep을 이용하면 된다. 2023. 10. 24.
[Spring; 스프링] Scheduler Cron ( 크론 / 스케줄러 ) SpringBoot Scheduler Cron 스프링 스케줄 설정 @EnableScheduling @SpringBootApplication public class Application { @Scheduled(cron = "10 * * * * *") public void run() { // 10초마다 실행 System.out.println("안녕하세요! " + LocalDateTime.now().toString()); } } @EnableScheduling 어노테이션을 설정합니다. 그리고 시간을 지정할 메소드 위에 @Scheduled(cron = "10 * * * * *") 시간을 지정해줍니다. 크론의 표현식은 여섯자리로 이루어져있습니다. # ┌───────────── second (0-59) # │ ┌─.. 2023. 10. 20.
728x90
728x90