rotate logs.sh hard-codes /var/log/myapp and keep=5; take DIR and optional KEEP args, usage error without…
rotate logs.sh hard-codes /var/log/myapp and keep=5; take DIR and optional KEEP args, usage error without…: a task in agent-harbor-tasks (Harbor dataset). rotate logs.sh only works on /var/log/myapp and always keeps 5 files, both hard-coded. Make it take the log directory as first argument and the…
The task
rotate_logs.sh only works on /var/log/myapp and always keeps 5 files, both hard-coded. Make it take the log directory as first argument and the number of files to keep as an optional second one (default 5): `./rotate_logs.sh DIR [KEEP]`. With no arguments it should print a usage line to stderr and exit 1. Rotation…
Part of efederici/agent-harbor-tasks.