-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean_trash.sh
More file actions
28 lines (25 loc) · 940 Bytes
/
clean_trash.sh
File metadata and controls
28 lines (25 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# 清理文件
# 开启通配符
shopt -s extglob
rm -rf /home/!(nvidia|storage|config.yaml|app*) && echo --------------清理文件完成--------------
rm -rf /home/storage/data/lidar/img /home/storage/data/lidar/log /home/storage/data/lidar/pcd
# if [ $(basename "${PWD}") == "auto_truck_script" ]; then
# deploy_path=$(dirname "${PWD}")
# fi
# cd $deploy_path
# # 待删除的文件和文件夹数组
# files_to_delete=("client.tar" "dataview.tar" "server.tar" "auto_truck_script" "lib2.zip" "lib.zip" "include2.zip" "include.zip" "bin.zip" "matrix.yaml" "share.zip" "nx_sq.tar.gz")
# # 遍历数组
# for item in "${files_to_delete[@]}"; do
# if [ -f "$item" ]; then
# echo "删除文件:$item"
# rm "$item"
# elif [ -d "${item%.zip}" ]; then
# echo "文件夹:${item%.zip}"
# echo "删除文件夹:${item%.zip}"
# rm -rf "${item%.zip}"
# else
# echo "$item 不存在"
# fi
# done