Still you don't understand me
I have made an example:
Code:
[pba@voodoo /tmp/test]$ ls -lia *
2008-01-01:
total 4
49358 drwxr-xr-x 2 pba wheel 512 Jul 23 21:25 .
49357 drwxr-xr-x 5 pba wheel 512 Jul 23 21:26 ..
49359 -rw-r--r-- 3 pba wheel 0 Jul 23 21:24 1
49360 -rw-r--r-- 3 pba wheel 0 Jul 23 21:24 2
49362 -rw-r--r-- 1 pba wheel 0 Jul 23 21:24 3
2008-01-02:
total 4
49363 drwxr-xr-x 2 pba wheel 512 Jul 23 21:25 .
49357 drwxr-xr-x 5 pba wheel 512 Jul 23 21:26 ..
49359 -rw-r--r-- 3 pba wheel 0 Jul 23 21:24 1
49360 -rw-r--r-- 3 pba wheel 0 Jul 23 21:24 2
2008-01-03:
total 4
49364 drwxr-xr-x 2 pba wheel 512 Jul 23 21:26 .
49357 drwxr-xr-x 5 pba wheel 512 Jul 23 21:26 ..
49359 -rw-r--r-- 3 pba wheel 0 Jul 23 21:24 1
49360 -rw-r--r-- 3 pba wheel 0 Jul 23 21:26 2
49366 -rw-r--r-- 1 pba wheel 0 Jul 23 21:26 4
So this gives me a total of five files stored: 1 2 3 4 5
If I delete the first directory, it will only free the space occupied by file 3.
If I delete the second directory also, it will not change anything, as the files 1 and 2 are also represented by the hard links in the third directory.
So the two tricky questions:
1. How do I find all files deleted before the last backup (in other words: not present in the last directory) and delete the inode, not just one hard link? Which would be file 3 in our example here. This should be easy by just deleting the directories!
2. How do I find out about the total amount of space consumed by those orphaned files? And this one is the tricky part