forked from NMAAHC/nmaahcmm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makegm
executable file
·165 lines (157 loc) · 13.2 KB
/
makegm
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#!/usr/bin/env bash
# makegm
# create Great Migration directory structure as set in gmconfig
### CONSTANTS
DATE_ISO="$(date +%Y%m%d)"
DATE_HYPHEN="$(date +%Y-%m-%d)"
CONFIG_TYPE="GM"
SCRIPT_PATH=${0%/*}
# script_path will be the directory path of {0} which is the script being called
. "${SCRIPT_PATH}/nmaahcmmfunctions"
# You can't directly call a function in another shell script.
# You can move your function definitions into a separate file and then load them into your script using the . command, like this:
# . /path/to/functions.sh
# This will interpret functions.sh as if it's content were actually present in your file at this point.
# This is a common mechanism for implementing shared libraries of shell functions.
[[ -f "${SCRIPT_PATH}/nmaahcmmfunctions" ]] || { echo "Missing '${SCRIPT_PATH}/nmaahcmmfunctions'. Exiting." ; exit 1 ;};
# will check to see that that nmaahcmmfunctions exists and if it doesn't (left side of || exits non-zero) then it will execute the right side of ||
### FUNCTIONS
makegm ()
{
GENERAL_NOTES="${CURRENT_GM_DIR}/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_generalNotes.txt"
touch "${GENERAL_NOTES}"
echo "These are general notes concerning the appointment of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} on ${DATE_HYPHEN}. They were written by the operator, ${GM_OPERATOR}, and contain observations about the appointment and information relayed by ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST}." >> "${GENERAL_NOTES}"
#35mm
if [ "${GM_FORMATS_35MM}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/35mm/ACCESS" "${CURRENT_GM_DIR}/35mm/PRESERVATION"
NOTES_35MM="${CURRENT_GM_DIR}/35mm/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_35mm_Notes.txt"
touch "${NOTES_35MM}"
echo "These are notes concerning the 35mm films of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were scanned on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the films, noted by the operator at the time of initial inspection and scanning, not content of the films." >> "${NOTES_35MM}"
fi
#16mm
if [ "${GM_FORMATS_16MM}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/16mm/ACCESS" "${CURRENT_GM_DIR}/16mm/PRESERVATION"
NOTES_16MM="${CURRENT_GM_DIR}/16mm/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_16mm_Notes.txt"
touch "${NOTES_16MM}"
echo "These are notes concerning the 16mm films of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were scanned on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the films, noted by the operator at the time of initial inspection and scanning, not content of the films." >> "${NOTES_16MM}"
fi
#Regular 8
if [ "${GM_FORMATS_R8}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/Regular8mm/ACCESS" "${CURRENT_GM_DIR}/Regular8mm/PRESERVATION"
R8_NOTES="${CURRENT_GM_DIR}/Regular8mm/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_Regular8mm_Notes.txt"
touch "${R8_NOTES}"
echo "These are notes concerning the Regular 8mm films of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were scanned on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the films, noted by the operator at the time of initial inspection and scanning, not content of the films." >> "${R8_NOTES}"
fi
#Super 8
if [ "${GM_FORMATS_S8}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/Super8/ACCESS" "${CURRENT_GM_DIR}/Super8/PRESERVATION"
S8_NOTES="${CURRENT_GM_DIR}/Super8/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_Super8_Notes.txt"
touch "${S8_NOTES}"
echo "These are notes concerning the Super 8 films of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were scanned on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the films, noted by the operator at the time of initial inspection and scanning, not content of the films." >> "${S8_NOTES}"
fi
#VHS
if [ "${GM_FORMATS_VHS}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/VHS/ACCESS" "${CURRENT_GM_DIR}/VHS/PRESERVATION"
VHS_NOTES="${CURRENT_GM_DIR}/VHS/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_VHS_Notes.txt"
touch "${VHS_NOTES}"
echo "These are notes concerning the VHS tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${VHS_NOTES}"
fi
#MiniDV
if [ "${GM_FORMATS_MINIDV}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/MiniDV/ACCESS" "${CURRENT_GM_DIR}/MiniDV/PRESERVATION"
MINIDV_NOTES="${CURRENT_GM_DIR}/MiniDV/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_MiniDV_Notes.txt"
touch "${MINIDV_NOTES}"
echo "These are notes concerning the MiniDV tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${MINIDV_NOTES}"
fi
#Video8
if [ "${GM_FORMATS_V8}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/Video8/ACCESS" "${CURRENT_GM_DIR}/Video8/PRESERVATION"
V8_NOTES="${CURRENT_GM_DIR}/Video8/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_V8_Notes.txt"
touch "${V8_NOTES}"
echo "These are notes concerning the Video8 tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${V8_NOTES}"
fi
#Hi8
if [ "${GM_FORMATS_HI8}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/Hi8/ACCESS" "${CURRENT_GM_DIR}/Hi8/PRESERVATION"
HI8_NOTES="${CURRENT_GM_DIR}/Hi8/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_Hi8_Notes.txt"
touch "${HI8_NOTES}"
echo "These are notes concerning the Hi8 tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${HI8_NOTES}"
fi
#Digital8
if [ "${GM_FORMATS_D8}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/Digital8/ACCESS" "${CURRENT_GM_DIR}/Digital8/PRESERVATION"
DIGITAL8_NOTES="${CURRENT_GM_DIR}/Digital8/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_Digital8_Notes.txt"
touch "${DIGITAL8_NOTES}"
echo "These are notes concerning the Digital8 tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${DIGITAL8_NOTES}"
fi
#U-matic
if [ "${GM_FORMATS_UMATIC}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/Umatic/ACCESS" "${CURRENT_GM_DIR}/Umatic/PRESERVATION"
UMATIC_NOTES="${CURRENT_GM_DIR}/Umatic/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_Umatic_Notes.txt"
touch "${UMATIC_NOTES}"
echo "These are notes concerning the U-matic tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${UMATIC_NOTES}"
fi
#Betacam
if [ "${GM_FORMATS_BETA}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/Betacam/ACCESS" "${CURRENT_GM_DIR}/Betacam/PRESERVATION"
BETA_NOTES="${CURRENT_GM_DIR}/Betacam/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_Betacam_Notes.txt"
touch "${BETA_NOTES}"
echo "These are notes concerning the Betacam tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${BETA_NOTES}"
fi
#BetacamSP
if [ "${GM_FORMATS_BETASP}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/BetacamSP/ACCESS" "${CURRENT_GM_DIR}/BetacamSP/PRESERVATION"
BETASP_NOTES="${CURRENT_GM_DIR}/BetacamSP/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_BetacamSP_Notes.txt"
touch "${BETASP_NOTES}"
echo "These are notes concerning the BetacamSP tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${BETASP_NOTES}"
fi
#DigiBeta
if [ "${GM_FORMATS_DIGIBETA}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/DigiBeta/ACCESS" "${CURRENT_GM_DIR}/DigiBeta/PRESERVATION"
DIGIBETA_NOTES="${CURRENT_GM_DIR}/DigiBeta/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_DigiBeta_Notes.txt"
touch "${DIGIBETA_NOTES}"
echo "These are notes concerning the DigiBeta tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${DIGIBETA_NOTES}"
fi
#1" Video
if [ "${GM_FORMATS_ONEINCHVIDEO}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/OneInchVideo/ACCESS" "${CURRENT_GM_DIR}/OneInchVideo/PRESERVATION"
ONEINCHVIDEO_NOTES="${CURRENT_GM_DIR}/OneInchVideo/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_OneInchVideo_Notes.txt"
touch "${ONEINCHVIDEO_NOTES}"
echo "These are notes concerning the 1-inch Video tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${ONEINCHVIDEO_NOTES}"
fi
#1/2" Video
if [ "${GM_FORMATS_HALFINCHVIDEO}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/HalfInchVideo/ACCESS" "${CURRENT_GM_DIR}/HalfInchVideo/PRESERVATION"
HALFINCHVIDEO_NOTES="${CURRENT_GM_DIR}/HalfInchVideo/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_HalfInchVideo_Notes.txt"
touch "${HALFINCHVIDEO_NOTES}"
echo "These are notes concerning the 1/2-inch Video tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${HALFINCHVIDEO_NOTES}"
fi
#Compact Audio Cassette
if [ "${GM_FORMATS_COMPACTAUDIOCASSETTE}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/AudioCassette/ACCESS" "${CURRENT_GM_DIR}/AudioCassette/PRESERVATION"
COMPACTAUDIOCASSETTE_NOTES="${CURRENT_GM_DIR}/AudioCassette/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_AudioCassette_Notes.txt"
touch "${COMPACTAUDIOCASSETTE_NOTES}"
echo "These are notes concerning the Compact Audio Cassette tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${COMPACTAUDIOCASSETTE_NOTES}"
fi
# 1/4" Open Reel Audio
if [ "${GM_FORMATS_QUARTERINCHOPENREELAUDIO}" = "1" ] ; then
mkdir -p "${CURRENT_GM_DIR}/QuarterInchOpenReel/ACCESS" "${CURRENT_GM_DIR}/QuarterInchOpenReel/PRESERVATION"
QUARTERINCHOPENREEL_NOTES="${CURRENT_GM_DIR}/QuarterInchOpenReel/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}_QuarterInchOpenReel_Notes.txt"
touch "${QUARTERINCHOPENREEL_NOTES}"
echo "These are notes concerning the 1/4-inch open reel tapes of ${GM_PROFILE_FIRST} ${GM_PROFILE_LAST} which were digitized on ${DATE_HYPHEN} by the operator ${GM_OPERATOR}. They cover technical and preservation concerns of the tapes, noted by the operator at the time of initial inspection and digitization, not content of the tapes." >> "${QUARTERINCHOPENREEL_NOTES}"
fi
}
#call the function(s)
CURRENT_GM_DIR="${GM_DIR}/${DATE_ISO}_${GM_PROFILE_LAST}_${GM_PROFILE_FIRST}"
mkdir -p "${CURRENT_GM_DIR}"
if [[ -d "${CURRENT_GM_DIR}" ]] ; then
_report -g "Success! Created your Great Migration directories at ${CURRENT_GM_DIR}"
makegm "${@}"
elif [[ -d "${GM_DIR}" ]] ; then
_report -r "Failed to create ${CURRENT_GM_DIR}. Do you have write permission to your Great Migration directory?"
ls -ld "${GM_DIR}"
_report -r "Exiting..."
else
_report -r "Failed to create ${CURRENT_GM_DIR} because there is no Great Migration directory at ${GM_DIR}"
fi
exit "$?"