gitlab/scripts/clean-old-cached-assets
Matthias Fechner ccf58807d3 Fix the shebang line for bash.
Not all systems having bash in `/bin`.
Use ´/usr/bin/env` to search for bash in `PATH`.
2020-05-16 10:53:05 +02:00

9 lines
443 B
Bash
Executable file

#!/usr/bin/env bash
# Clean up cached files that are older than 4 days
find tmp/cache/assets/sprockets/ -type f -mtime +4 -execdir rm -- "{}" \;
find tmp/cache/webpack-dlls/ -maxdepth 1 -type d -mtime +4 -exec rm -rf -- "{}" \;
du -d 0 -h tmp/cache/assets/sprockets | cut -f1 | xargs -I % echo "tmp/cache/assets/sprockets/ is currently %"
du -d 0 -h tmp/cache/webpack-dlls | cut -f1 | xargs -I % echo "tmp/cache/webpack-dlls is currently %"