#!/bin/bash
# author: ChiWeiming
# version: v1
# date: 2024-03-29
<<COMMANT
有一臺 WEB 伺服器上的目錄,不定時有使用者往該目錄上傳檔案,現在需要每隔 5 分鐘檢查一下是否有新檔案上傳,有的話需要將新檔案的列表輸出到一個按年月日時分的日誌檔案中。
COMMANT
file_suffix=$(date +%Y%m%d%H%M)
dir="/data/web/attachment"
find ${dir} -type f -mmin -5 > /tmp/newf.txt
if [[ -s /tmp/newf.txt ]]; then
/bin/mv /tmp/newf.txt /tmp/${file_suffix}
fi
shell practice 07
相關文章
- shell practice 04
- shell practice 06
- shell practice 03
- shell practice 05
- Practice
- airflow practiceAI
- scientifically practice DP
- Practice| 流程控制
- Best Practice in Writing
- 2008-06-07shell筆記筆記
- linux Shell 命令列-07-func 函式Linux命令列函式
- “Docker Practice”讀書筆記Docker筆記
- yolov5s ncnn practiceYOLOCNN
- R1-007 Shell變數簡介2變數
- Spring Boot In Practice (0):基礎Spring Boot
- css best practice for big team and projectCSSProject
- 關於MASTER=spark://SparkMaster:7077 ./spark-shell問題ASTSpark
- Oracle 12.2 RAC on Linux Best Practice DocumentationOracleLinux
- A+B for Input-Output Practice (IV) (sdut oj)
- Practice5.1 測試與封裝5.1封裝
- Practice - iOS 專案持續整合實踐(一)iOS
- Practice – iOS 專案持續整合實踐(一)iOS
- Spring Boot In Practice (1):Redis快取實戰Spring BootRedis快取
- webpack-best-practice-最佳實踐-部署生產Web
- 【20240709】海量圖片匯出需求,shell指令碼指令碼
- HDOJ 1094 A+B for Input-Output Practice (VI)
- Operating Systems: Principles and Practice 2nd ed. Edition
- Oracle GoldenGate Best Practice - sample parameter files (文件 ID 1321696.1)OracleGo
- SDNU_ACM_ICPC_2021_Winter_Practice_4th [個人賽]ACM
- 1.2 基礎知識——關於豬皮(GP,Generic Practice)
- [20210107]編寫bash shell指令碼遇到的問題.txt指令碼
- 打字大師3-盲打實踐:Master of Typing 3 - Practice for MacASTMac
- Oracle GoldenGate Best Practice - Testing Maximum Performance of Disks in UNIX [ID 1356855.1]OracleGoORM
- shell中呼叫shell的三種方式&並行shell並行
- [Shell] Shell 生成 HTML指令碼HTML指令碼
- PAT (Advanced Level) Practice 1149 Dangerous Goods Packaging (25分)Go
- Security configuration of SSH login entry - enterprise security practice
- best practice of rebuild your partition table local index online by using: "update indexes"RebuildIndex