Bài đăng

Bash Script: Xoá bỏ các thư mục cũ sau khi releases phiên bản mới

Hình ảnh
Đối với việc thực hiện CI/CD, kịch bản thường thấy sẽ là Tạo 1 thư mục mới theo cấu trúc nhất định Code sau khi được build và test, sẽ được đồng bộ vào thư mục mới Tạo symbolic linking folder production tới thư mục mới Triển khai test trên Production Giữ lại thư mục cũ ít nhất sau 1 khoảng thời gian để rollback khi cần Đến đây có 1 vấn đề nảy sinh. Làm sao để định kỳ xoá các folder cũ khi deploy. Vậy thì script dưới đây là lời giải cho bài toán trên

Journalctl: How to Read and Edit Systemd Logs

Hình ảnh
  Introduction Systemd logs all  Linux  messages from the  kernel  and system processes. The journalctl command enables viewing and editing the systemd logs, making it a powerful tool for service and process debugging. This guide shows how to read, control, and maintain systemd logs using journalctl through examples. Prerequisites Access to the command line/terminal window. A text editor (such as  nano ) to edit the config file. A user with sudo privileges (see how to  add a user to sudoers ). What Is Systemd? Systemd is a Linux service and system manager. While users do not invoke systemd directly, the manager contains many tools and daemons to run individually for various system processes. One of the most powerful systemd functionalities is the logging features. Systemd provides a centralized solution for logging all  kernel  and user processes through logs known as  journals . The  journald  daemon collects all the messages the system outputs and then creates journals, regardless of