This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Filelight: Incorrect results using hard links

Tags: None
(comma "," separated)
davidone
Registered Member
Posts
1
Karma
0
Hi. Filelight is great! Accessible by default at the bottom of Dolphin by clicking the bar to the left of the drive freespace.

I'm showing incorrect results from Filelight. By default, it scans the filesize for every file on the filesystem. It does ignore symlinks, but not hardlinks.

There's 3 issues that I see.
  1. Slows down scans
  2. May cause user to incorrectly delete/move data based on filelight results
  3. May cause user to unnecessarily expand filesystems/storage

I doubt this is a big issue with a default system (I'm unsure how many hard links are in a default install.) But with a backup strategy such as below, this may eventually result in a case where the total size reported by filelight exceeds the capacity of the filesystem. I executed the backup script below every hour, and from 15 backups + one symlink Filelight says I have 2.4TB in /bak, 188.7GB in /. Yet `zfs list` states /bak is 227GB

Code: Select all
#!/bin/bash
set -o nounset
set -o pipefail
readonly BIN_DIR="${HOME}/bin"
readonly SOURCE_DIR="/"
readonly BACKUP_DIR="/bak"
readonly DATETIME="$(date '+%Y-%m-%d_%H:%M:%S')"
readonly BACKUP_PATH="${BACKUP_DIR}/${DATETIME}"
readonly LATEST_LINK="${BACKUP_DIR}/latest"
readonly EXCLUDE_LIST="${BIN_DIR}/exclude.list"
readonly LOG_FILE="${BIN_DIR}/bak.log"
while [ `pgrep -n rsync` ]
do
  sleep 1
done

rsync -aAXv --delete "${SOURCE_DIR}/" --link-dest "${LATEST_LINK}" --exclude-from="${EXCLUDE_LIST}" "${BACKUP_PATH}" > "${LOG_FILE}" 2>&1
rm -rf "${LATEST_LINK}"
ln -s "${BACKUP_PATH}" "${LATEST_LINK}"
echo `date` >> "${LOG_FILE}"


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]