-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path23-image-dedup.sh
More file actions
executable file
·32 lines (25 loc) · 1011 Bytes
/
23-image-dedup.sh
File metadata and controls
executable file
·32 lines (25 loc) · 1011 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
#!/bin/bash
# Wrapper script for image-dedup.py script
# Cycles through the list of images
# Updates path to image
# Moves image to temp dir outside of working dir
# Deletes every instance of the image
# Moves image into the new images directory
# Moving preserves the original creation date of the file
# Update the hardcoded paths as needed..
mkdir path/to/web_root/images
# List of images, one per line
IMG_LIST="image1.gif
image2.gif
image3.jpg"
# Loop through each image in the list
while IFS= read -r IMAGE; do
# Replace "image-dedup.py" with your actual script name
python3 23-image-dedup.py path/to/web_root "$IMAGE"
# Move the processed image to the specified directory
mv "path/to/web_root/$IMAGE" images/
# Find and delete the original image in the "content" directory
find path/to/web_root -name "$IMAGE" -print -delete
# Move the processed image to the "content/images" directory
mv "images/$IMAGE" "path/to/web_root/images/"
done <<< "$IMG_LIST"