puh current config pre departure
This commit is contained in:
@ -51,10 +51,41 @@
|
||||
|
||||
- name: carputer - photo_refresh - Start container at 0.0.0.0:8080
|
||||
shell: "docker-compose -f {{ photo_refresh_folder }}/docker-compose.yaml up -d"
|
||||
register: local_index_output
|
||||
register: docker_output
|
||||
- debug: |
|
||||
msg="{{ local_index_output.stdout_lines }}"
|
||||
msg="{{ local_index_output.stderr_lines }}"
|
||||
msg="{{ docker_output.stdout_lines }}"
|
||||
msg="{{ docker_output.stderr_lines }}"
|
||||
|
||||
###############################################
|
||||
# set up thumbnail_purge
|
||||
###############################################
|
||||
|
||||
- name: timelapse - purge thumbnail cron job
|
||||
block:
|
||||
|
||||
- name: timelapse - create purge script
|
||||
copy:
|
||||
dest: "{{ photo_refresh_folder }}/purge_thumbnails.sh"
|
||||
content: |
|
||||
#!/bin/bash
|
||||
TARGET_DIR="{{ working_folder }}/small_thumbs"
|
||||
cd "$TARGET_DIR" || exit
|
||||
# Find all files, sort them by modification time (oldest first), and delete all but the 50 most recent
|
||||
ls -t | tail -n +1000 | while read -r file; do
|
||||
if [ -f "$file" ]; then
|
||||
# echo "Deleting file: $file"
|
||||
rm "$file"
|
||||
fi
|
||||
done
|
||||
mode: 0755
|
||||
|
||||
- name: timelapse - add purge to cron
|
||||
copy:
|
||||
dest: "/etc/cron.d/purge_thumbnails"
|
||||
content: |
|
||||
# This is for deleting the small thumbnails generated by the timelapse
|
||||
# It should run once an hour
|
||||
00 * * * * root {{ photo_refresh_folder }}/purge_thumbnails.sh
|
||||
mode: 0755
|
||||
|
||||
...
|
||||
Reference in New Issue
Block a user