我需要找出上市在兩個不同時間之間的文件系統路徑(/home/user01/myapps/
)更新已添加文件或文件夾/(腳本開始和結束時間) 。Unix命令用於查找更新和新添加的文件/文件夾
我運行一個Shell腳本做更新/添加新文件從不同的源資源路徑/home/user01/myapps/
。所以,在腳本結尾,我想知道已添加或更新的文件或文件夾的列表。
我有下面的命令
查找/選擇/應用/ TDS/tdsbatch -mtime -1
但是,我不知道有關腳本運行時間。
確實有幫助!根據您的需要
# record the current time in seconds on script startup
start_time=$(date +%s)
...
# do whatever you like
...
# to get the runtime in secods - if you like:
runtime=$(($(date +%s) - start_time))
# to get the runtime in minutes (minutes are useful for -mmin find param)
runtime=$((($(date +%s) - start_time)/60))
...
# to record the finish time in seconds:
end_time=$(date +%s)
現在find
:
你會怎麼做n'不確定腳本運行時間'。請更新您的問題以包含您需要的示例輸出。祝你好運。 – shellter