Main issue is that df output is unreliable, so clean.sh should be reworked:
-
it should be running separately from backup.sh, about once an hour
-
when less than 10% disk space left - it should start deleting files, keeping note on their sizes
-
when sum of sizes deleted files is more than 10% of disk space - stop and run sudo btrfs balance start -dusage=50
-
main backup.sh should just refuse to do anything when there's less than 10% disk space free
Main issue is that
dfoutput is unreliable, so clean.sh should be reworked:it should be running separately from backup.sh, about once an hour
when less than 10% disk space left - it should start deleting files, keeping note on their sizes
when sum of sizes deleted files is more than 10% of disk space - stop and run
sudo btrfs balance start -dusage=50main backup.sh should just refuse to do anything when there's less than 10% disk space free