Hi guys,
On one of our backup machines I noticed the number of snapshots growing and growing. When checking the backup script I noticed that the [cmd=""]zfs receive[/cmd] command was using the "-F" flag, which should normally (quote from the man page) "destroy snapshots and file systems that do not exist on the sending side".
I also tried it manually and for some reason, it does not work. The machines in question are 9-STABLE (r236943 and r236355) amd64.
The cmd's I used for manual checking were:
[cmd=""]zfs create rpool/test[/cmd]
[cmd=""]zfs snapshot rpool/test@snap1[/cmd]
[cmd=""]zfs snapshot rpool/test@snap2[/cmd]
[cmd=""]zfs snapshot rpool/test@snap3[/cmd]
[cmd=""]zfs snapshot rpool/test@snap4[/cmd]
[cmd=""]zfs send rpool/test@snap1 | ssh -c arcfour ssh backup.local zfs receive -F backup/test[/cmd]
[cmd=""]zfs send -i snap1 rpool/test@snap2 | ssh -c arcfour ssh backup.local zfs receive -F backup/test[/cmd]
[cmd=""]zfs send -i snap2 rpool/test@snap3 | ssh -c arcfour ssh backup.local zfs receive -F backup/test[/cmd]
[cmd=""]zfs destroy rpool/test@snap1[/cmd]
[cmd=""]zfs send -i snap3 rpool/test@snap4 | ssh -c arcfour ssh backup.local zfs receive -F backup/test[/cmd]
At this point snap2, snap3 and snap4 should be present on the backup machine and snap1 shuold be gone. Unfortunately, snap1 does not get deleted.
What am I missing?
On one of our backup machines I noticed the number of snapshots growing and growing. When checking the backup script I noticed that the [cmd=""]zfs receive[/cmd] command was using the "-F" flag, which should normally (quote from the man page) "destroy snapshots and file systems that do not exist on the sending side".
I also tried it manually and for some reason, it does not work. The machines in question are 9-STABLE (r236943 and r236355) amd64.
The cmd's I used for manual checking were:
[cmd=""]zfs create rpool/test[/cmd]
[cmd=""]zfs snapshot rpool/test@snap1[/cmd]
[cmd=""]zfs snapshot rpool/test@snap2[/cmd]
[cmd=""]zfs snapshot rpool/test@snap3[/cmd]
[cmd=""]zfs snapshot rpool/test@snap4[/cmd]
[cmd=""]zfs send rpool/test@snap1 | ssh -c arcfour ssh backup.local zfs receive -F backup/test[/cmd]
[cmd=""]zfs send -i snap1 rpool/test@snap2 | ssh -c arcfour ssh backup.local zfs receive -F backup/test[/cmd]
[cmd=""]zfs send -i snap2 rpool/test@snap3 | ssh -c arcfour ssh backup.local zfs receive -F backup/test[/cmd]
[cmd=""]zfs destroy rpool/test@snap1[/cmd]
[cmd=""]zfs send -i snap3 rpool/test@snap4 | ssh -c arcfour ssh backup.local zfs receive -F backup/test[/cmd]
At this point snap2, snap3 and snap4 should be present on the backup machine and snap1 shuold be gone. Unfortunately, snap1 does not get deleted.
What am I missing?