scripts/backup/backup_manager_daxik.sh

11 lines
273 B
Bash
Raw Permalink Normal View History

2023-02-04 06:33:08 +03:00
#!/bin/bash
#Script that manages backups by leca@foxarmy.org
#count every dir
count=$(find . -maxdepth 1 -type d -not -name "." | wc -l)
#if there are more than 5 directories, delete the oldest one.
if [ $count -gt 5 ]; then
rm -rf $(ls -d -t1 */ | tail -n 1)
fi