-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfinding
More file actions
50 lines (37 loc) · 879 Bytes
/
finding
File metadata and controls
50 lines (37 loc) · 879 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
##########################################
#
# Find and convert file from folder
#
# finding /folder/path *.m4v
#
# (c) 2018, Edoardo Marchetti <marchetti.edoardo@gmail.com>
# https://github.com/jas31085/Libra_310-Script-Collection
#
##########################################
LogFile="/var/log/FindingConversion"
if [[ ! -z "$(ps -ef | grep $0 | awk '{ print $2 }' )" ]]; then
echo " Script already running"
exit 1
fi
if [[ -e "/opt/Convert" ]]; then
Convert="/opt/Convert"
else
echo " Script not Found in /opt/"
exit 1
fi
if [[ -d "$1" ]]; then
Folder="$1"
else
echo " Folder not exist"
exit 1
fi
TYPE="*.mkv"
if [[ ! "$2" ]]; then
TYPE="$2"
fi
echo "Start Finding File " $(date) >> $LogFile
echo ""
find "$Folder" -name "$TYPE" -exec bash -x $Convert {} \; &>> $LogFile
echo "Stop Finding File " $(date)>> $LogFile
echo "" >> $LogFile