This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| for i in "media_store/remote_content remote_media_cache" "media_store/remote_thumbnail remote_media_cache_thumbnails"; do ( | |
| fgxd() { dir="$1"; table="$2"; } | |
| fgxd $i | |
| cd "$dir"; | |
| sudo -u postgres psql -U synapse -A -c 'select '"CONCAT(media_origin,'/',filesystem_id)"' from '"$table"';' | | |
| tail -n+2 | head -n-1 | sed -E 's|/(..)(..)|/\1/\2/|' | | |
| while read line; do ( | |
| if stat "$line" >/dev/null 2>&1; then | |
| :; |