-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstash.bash
More file actions
executable file
·53 lines (50 loc) · 1.06 KB
/
Copy pathstash.bash
File metadata and controls
executable file
·53 lines (50 loc) · 1.06 KB
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
#!/bin/bash
while getopts a option
do
case "${option}"
in
a) ATOMIC=true
esac
done
for vid in `ls -1 *.m4v *.mp4 2>/dev/null`;
do
date=`echo $vid | cut -d _ -f2 | tr -d 'v'`
tim=20${date}1200
if [ "$ATOMIC" = true ]
then
yr=`echo $date | cut -c1-2`
mo=`echo $date | cut -c3-4`
da=`echo $date | cut -c5-6`
utc=20${yr}-${mo}-${da}T12:00:00Z
echo $utc : $tim : $vid
if ! AtomicParsley ${vid} --year "${utc}" --purchaseDate "${utc}" --overWrite
then
if ! AtomicParsley ${vid} --year "${utc}" --purchaseDate "${utc}"
then
FAILURE=true
fi
fi
AtomicParsley ${vid} -t
else
echo $tim : $vid
fi
touch -t $tim $vid
done
for pic in `ls -1 *.pdf *.cbz 2>/dev/null`;
do
date=`echo $pic | cut -d _ -f2 | tr -d 'p'`
tim=20${date}1200
echo $tim : $pic
touch -t $tim $pic
done
if [ "$ATOMIC" = true ]
then
if [ "$FAILURE" = true ]
then
echo "!!" AtomicParsley FAIL
fi
for tmp in `ls -1 *-temp-*.mp4 *-temp-*.m4v 2>/dev/null`;
do
echo "!!" AtomicParsley overwrite error: $tmp
done
fi